CreateAPI
CreateAPI copied to clipboard
fix: Discriminator respects useSwiftyPropertyNames
JSON parsing for discriminators fails when the discriminator's propertyName has an _ in it, and the default value of swiftyPropertyNames is true
this fix uses the PropertyName processing to respect the options passed into the generator
in practice, a JSONDecoder with .keyDecodingStrategy = .convertFromSnakeCase set will fail to parse some_kind since it's looking for someKind instead.
this change will result in this being generated instead
struct Discriminator: Decodable {
- let some_kind: String
+ let someKind: String
}