JSON Encoding / Decoding weird encoding of dictionary with enum values

This is expected.

Only dictionaries with Int or String key types get encoded into keyed containers (-> JSON dictionaries). Since other encodable types could encode to dictionaries/arrays, which can't be used as keys, dictionaries will encode as an array of alternating keys and values when the key type is not Int or String.

This is the relevant code:

1 Like