You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
union types with schemas work by rescuing ValidationError and continuing to try the next type when one doesn't work.
but ValidationError isn't raised when :record_errors is true, so when the second (or later) union type is the valid one, the error gets added on the first (invalid) union type, and not removed when the valid union type is found.
example with a union type of a schema and 'boolean' follows.
record_errors is true; reports failure encountered validating the first union type:
>> JSON::Validator.fully_validate({'properties'=>{'data'=>{'type'=>[{'type'=>'object'},'boolean']}}},{'data'=>false})=>["The property '#/data' of type FalseClass did not match one or more of the following types: object in schema 4e2b2f95-fe4c-5581-b5a7-236873957b50#"]
The text was updated successfully, but these errors were encountered:
union types with schemas work by rescuing ValidationError and continuing to try the next type when one doesn't work.
but ValidationError isn't raised when :record_errors is true, so when the second (or later) union type is the valid one, the error gets added on the first (invalid) union type, and not removed when the valid union type is found.
example with a union type of a schema and 'boolean' follows.
:record_errors is false; works fine:
record_errors is true; reports failure encountered validating the first union type:
The text was updated successfully, but these errors were encountered: