|
1 | 1 | <?xml version="1.0" encoding="US-ASCII"?>
|
2 | 2 | <!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
|
3 | 3 | <!ENTITY RFC1034 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1034.xml">
|
| 4 | +<!ENTITY RFC2045 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2045.xml"> |
| 5 | +<!ENTITY RFC2046 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2046.xml"> |
4 | 6 | <!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
|
5 | 7 | <!ENTITY RFC2373 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2373.xml">
|
6 | 8 | <!ENTITY RFC2673 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2673.xml">
|
|
899 | 901 | </section>
|
900 | 902 | </section>
|
901 | 903 |
|
| 904 | + <section title='String-encoding non-JSON data'> |
| 905 | + |
| 906 | + <section title="Foreword"> |
| 907 | + <t> |
| 908 | + Properties defined in this section indicate that an instance contains |
| 909 | + non-JSON data encoded in a JSON string. |
| 910 | + They describe the type of content and how it is encoded. |
| 911 | + </t> |
| 912 | + </section> |
| 913 | + |
| 914 | + <section title="contentEncoding"> |
| 915 | + |
| 916 | + <t> |
| 917 | + If the instance value is a string, this property defines that the string |
| 918 | + SHOULD be interpreted as binary data and decoded using the encoding |
| 919 | + named by this property. |
| 920 | + <xref target="RFC2045">RFC 2045, Sec 6.1</xref> lists the possible |
| 921 | + values for this property. |
| 922 | + </t> |
| 923 | + |
| 924 | + <t> |
| 925 | + The value of this property MUST be a string. |
| 926 | + </t> |
| 927 | + |
| 928 | + <t> |
| 929 | + The value of this property SHOULD be ignored if the instance described is not a |
| 930 | + string. |
| 931 | + </t> |
| 932 | + |
| 933 | + </section> |
| 934 | + |
| 935 | + <section title="contentMediaType"> |
| 936 | + <t> |
| 937 | + The value of this property must be a media type, as defined by |
| 938 | + <xref target="RFC2046">RFC 2046</xref>. This property defines the media |
| 939 | + type of instances which this schema defines. |
| 940 | + </t> |
| 941 | + |
| 942 | + <t> |
| 943 | + The value of this property MUST be a string. |
| 944 | + </t> |
| 945 | + |
| 946 | + <t> |
| 947 | + The value of this property SHOULD be ignored if the instance described is not a |
| 948 | + string. |
| 949 | + </t> |
| 950 | + |
| 951 | + <t> |
| 952 | + If the "contentEncoding" property is not present, but the instance value is a |
| 953 | + string, then the value of this property SHOULD specify a text document type, |
| 954 | + and the character set SHOULD be the character set into which the JSON string |
| 955 | + value was decoded (for which the default is Unicode). |
| 956 | + </t> |
| 957 | + </section> |
| 958 | + |
| 959 | + <section title="Example"> |
| 960 | + <figure> |
| 961 | + <preamble> |
| 962 | + Here is an example schema, illustrating the use of "contentEncoding" and |
| 963 | + "contentMediaType": |
| 964 | + </preamble> |
| 965 | + <artwork> |
| 966 | +<![CDATA[ |
| 967 | +{ |
| 968 | + "type": "string", |
| 969 | + "contentEncoding": "base64", |
| 970 | + "contentMediaType": "image/png" |
| 971 | +} |
| 972 | +]]> |
| 973 | + </artwork> |
| 974 | + <postamble> |
| 975 | + Instances described by this schema should be strings, and their values |
| 976 | + should be interpretable as base64-encoded PNG images. |
| 977 | + </postamble> |
| 978 | + </figure> |
| 979 | + |
| 980 | + <figure> |
| 981 | + <preamble> |
| 982 | + Another example: |
| 983 | + </preamble> |
| 984 | + <artwork> |
| 985 | +<![CDATA[ |
| 986 | +{ |
| 987 | + "type": "string", |
| 988 | + "contentMediaType": "text/html" |
| 989 | +} |
| 990 | +]]> |
| 991 | + </artwork> |
| 992 | + <postamble> |
| 993 | + Instances described by this schema should be strings containing HTML, using |
| 994 | + whatever character set the JSON string was decoded into (default is |
| 995 | + Unicode). |
| 996 | + </postamble> |
| 997 | + </figure> |
| 998 | + </section> |
| 999 | + |
| 1000 | + </section> |
| 1001 | + |
902 | 1002 | <section title="Security considerations">
|
903 | 1003 | <t>
|
904 | 1004 | JSON Schema validation defines a vocabulary for JSON Schema core and concerns all
|
|
940 | 1040 |
|
941 | 1041 | <references title="Informative References">
|
942 | 1042 | &RFC1034;
|
| 1043 | + &RFC2045; |
| 1044 | + &RFC2046; |
943 | 1045 | &RFC2373;
|
944 | 1046 | &RFC2673;
|
945 | 1047 | &RFC3339;
|
|
0 commit comments