JSON decoder not properly decoding `defaultConfigurationIsVisible` in some projects
tjwio opened this issue Β· comments
Tim Wong commented
Context π΅οΈββοΈ
Some of our projects generated via BUCK have a plist encoding so the property looks like:
<key>defaultConfigurationIsVisible</key>
<false/>
instead of something like:
defaultConfigurationIsVisible = 0;
This causes the JSON encoder to encode the property as a boolean instead of a string, so the JSON decoder fails to decode that boolean properly since it thinks it's a string
What π±
This error is thrown when trying to decode defaultConfigurationIsVisible
error: typeMismatch(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "defaultConfigurationIsVisible", intValue: nil)], debugDescription: "Expected to decode String but found a number instead.", underlyingError: nil))