By adding : The
contentMediaType
and contentEncoding
Example
Here is an example schema, illustrating the use of "contentEncoding" and "contentMediaType":
{ "type": "string", "contentEncoding": "base64", "contentMediaType": "image/png" }
Instances described by this schema should be strings, and their values should be interpretable as base64-encoded PNG images.
Another example:
{ "type": "string", "contentMediaType": "text/html" }
Instances described by this schema should be strings containing HTML, using whatever character set the JSON string was decoded into (default is Unicode)
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.
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).