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
I am trying to run a JSON hyper-schema check against a base64 image definition using json-schema-validator. I am using the java version of json-schema-validator, version is 2.2.5.
The media keyword is defined by JSON hyper schema, not JSON schema proper; as such, it is not validated by the implementation.
Not sure what the intent of the spec will be here, since this scenario is not covered by either the validation spec or the hyperschema spec... @geraintluff, any thoughts?
As a workaround, since you are using my implementation, you can define a new keyword which mimics hyper schema's "media"; but since your use case is not defined by the specs, it will be a one off solution...
There's nothing stopping you from validating using the media keyword, but it's not mandated as it's not part of the validation spec. A validator that takes heed of hyper-schema keywords like this is sometimes called a "hyper-validator".
Any validation using hyper-schema keywords should be done in a second pass, after schema-assignment has already taken place, otherwise you might mess with oneOf/not clauses etc. - this is the same stage at which you would do hyperlink inference if you were interested in that. (@fge, does your library support schema assignment?)
(also, off-topic: "ABCDE" might well pass anyway, as the =-padding is often considered optional)
I am trying to run a JSON hyper-schema check against a base64 image definition using json-schema-validator. I am using the java version of json-schema-validator, version is 2.2.5.
My schema is:
My json object is:
The validate() method returns success. However, "ABCDE" is not a valid Base64 string. There should be an error entry in the validation report.
Also, would
be an appropriate way to limit the base64 size (image size) or is there another better way of defining this?
The text was updated successfully, but these errors were encountered: