mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-14 08:23:45 +00:00
Changes the logic of parsing of OneOf/AnyOf to fix incorrect type coercion in OneOf/AnyOf contexts. The guard which checks whether typed_data is true-ish fails for booleans. If the oneOf includes a boolean type and the data is false then it will correctly parse this value as a boolean. However, the guard class will determine that false is not true-ish and therefore returns nil. So the result of the type coercion of false will be nil. This can result in problems when dealing with default true. For example how a false can turn into a true with defaults: 1. The API returns false 2. The type coercion determines false becomes nil 3. When storing this retrieved record with a default of true for this column the stored value is suddenly true while the API specifically returned false This fix removes this guard and will rely on the exception raised to return nil when type coercion fails.