Maik Dijkstra 9b692e5ef7
fix(ruby-client): Fix incorrect boolean parsing in OneOf/AnyOf (#21943)
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.
2025-09-11 20:46:06 +08:00
..