Open joeydh opened 5 years ago
yeah the validation support for draft-07 is definitely not complete here still.
@erosb Hi! Any progress on this issue? Is there a possibility of fixing this in any of the future releases?
I'm happy to merge if someone implements it, but I don't plan to add this feature. Other implementations don't have much support for contentMediaType-based validation either.
Thanks for the quick reply. I'll try to dive into the project and see if I'm capable of implementing such feature.
Dear Everit,
I am trying to put an image in data and validate it but the validations are not working and I think its missing.
When I look at the specification of draft-7(https://json-schema.org/draft-07/json-schema-validation.html) I see:
8.3. contentEncoding If the instance value is a string, this property defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this property. RFC 2045, Sec 6.1 [RFC2045] lists the possible values for this property.
The value of this property MUST be a string.
The value of this property SHOULD be ignored if the instance described is not a string.
8.4. contentMediaType The value of this property must be a media type, as defined by RFC 2046 [RFC2046]. This property defines the media type of instances which this schema defines.
The value of this property MUST be a string.
The value of this property SHOULD be ignored if the instance described is not a string.
If the "contentEncoding" property is not present, but the instance value is a string, then the value of this property SHOULD specify a text document type, and the character set SHOULD be the character set into which the JSON string value was decoded (for which the default is Unicode).
8.5. Example Here is an example schema, illustrating the use of "contentEncoding" and "contentMediaType":
Instances described by this schema should be strings, and their values should be interpretable as base64-encoded PNG images.
Another example:
Instances described by this schema should be strings containing HTML, using whatever character set the JSON string was decoded into (default is Unicode).
But If I put those validations in the JSONSchema nothing happens and it will just succeed, even if the base64 is not valid or not a base64 at all