Specifically, it treats Int
and String
as CodingKey
s with the equivalent intValue
/stringValue
which allows it to encode as an actual dictionary as opposed to the more general types.
From the last time @Lantua and I discussed this (), see the links below for some more background on this:
If you need to specifically maintain a dictionary format here, your best bet is to encode and decode as [Int: String]
but perform the conversion to Int32
afterwards.