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
It does not return any errors even though clearly the data array should not match the schema.
One hack workaround I tried is just throwing an error if data, converted to a string, starts with a "[", but that's obviously a hack.
Am I required to use ":strict => true" in this case (I'd rather not so as to allow flexibility in having other fields sent to the Schema Validator)? Has anyone else run into this?
The text was updated successfully, but these errors were encountered:
Why shouldn't it match the schema? The schema does not require 'object' or any particular type for the data. And it only states that if there is a property 'my_field' then it must be of type string, but it may also be absent as it is not declared as required.
I'd agree with you if the validation still succeeds if there is a top-lebel 'type' definition of something that prohibits an array.
I've run into an issue where comparing a an array of data successfully validates against a schema I maintain when it shouldn't.
For example, if I have a schema file I maintain called schema.json which has a body like:
Which I know works from validating other non-array JSON objects against it.
But when I set the following variable:
And call:
It does not return any errors even though clearly the data array should not match the schema.
One hack workaround I tried is just throwing an error if data, converted to a string, starts with a "[", but that's obviously a hack.
Am I required to use ":strict => true" in this case (I'd rather not so as to allow flexibility in having other fields sent to the Schema Validator)? Has anyone else run into this?
The text was updated successfully, but these errors were encountered: