# Codable synthesis for enums with associated values

**URL:** <https://forums.swift.org/t/codable-synthesis-for-enums-with-associated-values/41493>\
**Category:** Pitches\
**Tags:** codable\
**Created:** [October 27, 2020, 12:17am UTC](https://forums.swift.org/t/codable-synthesis-for-enums-with-associated-values/41493 "2020-10-27T00:17:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![itaiferber](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/itaiferber/32/33840_2.png) [@itaiferber](https://forums.swift.org/u/itaiferber)\
**Post date:** [October 27, 2020, 1:06am UTC](https://forums.swift.org/t/codable-synthesis-for-enums-with-associated-values/41493/2 "2020-10-27T01:06:39Z")

</div>

Happy to see a pitch in this area! I think this is a good start in the direction of having _something_ in place for `enum`s which has been missing for a long time. I'm wondering about a few cases here which are not explicitly discussed in the pitch:

1. What about `enum` cases without associated values? Are those still encoded as keyed containers, or single values? For instance, `.load` in

2. What about `enum` cases that share a name? For instance, both cases of

3. It would be nice to see some Alternatives Considered/Future Directions with some discussion about other approaches. For instance, from a lot of discussion in [Automatic Codable conformance for enums with associated values that themselves conform to Codable](https://forums.swift.org/t/automatic-codable-conformance-for-enums-with-associated-values-that-themselves-conform-to-codable/11499) and similar threads, we know that different folks have differing opinions on what they would expect to be a default implementation based on their needs.

---

_[View the full topic](https://forums.swift.org/t/codable-synthesis-for-enums-with-associated-values/41493)._
