This repository was archived by the owner on Nov 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 213
/
Copy pathjson-schema-hypermedia.html
1292 lines (1206 loc) · 62 KB
/
json-schema-hypermedia.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<title>JSON Hyper-Schema: Hypertext definitions for JSON Schema</title>
<style type="text/css" title="Xml2Rfc (sans serif)">
/*<![CDATA[*/
a {
text-decoration: none;
}
/* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
a.info {
/* This is the key. */
position: relative;
z-index: 24;
text-decoration: none;
}
a.info:hover {
z-index: 25;
color: #FFF; background-color: #900;
}
a.info span { display: none; }
a.info:hover span.info {
/* The span will display just on :hover state. */
display: block;
position: absolute;
font-size: smaller;
top: 2em; left: -5em; width: 15em;
padding: 2px; border: 1px solid #333;
color: #900; background-color: #EEE;
text-align: left;
}
a.smpl {
color: black;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}
address {
margin-top: 1em;
margin-left: 2em;
font-style: normal;
}
body {
color: black;
font-family: verdana, helvetica, arial, sans-serif;
font-size: 10pt;
max-width: 55em;
}
cite {
font-style: normal;
}
dd {
margin-right: 2em;
}
dl {
margin-left: 2em;
}
ul.empty {
list-style-type: none;
}
ul.empty li {
margin-top: .5em;
}
dl p {
margin-left: 0em;
}
dt {
margin-top: .5em;
}
h1 {
font-size: 14pt;
line-height: 21pt;
page-break-after: avoid;
}
h1.np {
page-break-before: always;
}
h1 a {
color: #333333;
}
h2 {
font-size: 12pt;
line-height: 15pt;
page-break-after: avoid;
}
h3, h4, h5, h6 {
font-size: 10pt;
page-break-after: avoid;
}
h2 a, h3 a, h4 a, h5 a, h6 a {
color: black;
}
img {
margin-left: 3em;
}
li {
margin-left: 2em;
margin-right: 2em;
}
ol {
margin-left: 2em;
margin-right: 2em;
}
ol p {
margin-left: 0em;
}
p {
margin-left: 2em;
margin-right: 2em;
}
pre {
margin-left: 3em;
background-color: lightyellow;
padding: .25em;
}
pre.text2 {
border-style: dotted;
border-width: 1px;
background-color: #f0f0f0;
width: 69em;
}
pre.inline {
background-color: white;
padding: 0em;
}
pre.text {
border-style: dotted;
border-width: 1px;
background-color: #f8f8f8;
width: 69em;
}
pre.drawing {
border-style: solid;
border-width: 1px;
background-color: #f8f8f8;
padding: 2em;
}
table {
margin-left: 2em;
}
table.tt {
vertical-align: top;
}
table.full {
border-style: outset;
border-width: 1px;
}
table.headers {
border-style: outset;
border-width: 1px;
}
table.tt td {
vertical-align: top;
}
table.full td {
border-style: inset;
border-width: 1px;
}
table.tt th {
vertical-align: top;
}
table.full th {
border-style: inset;
border-width: 1px;
}
table.headers th {
border-style: none none inset none;
border-width: 1px;
}
table.left {
margin-right: auto;
}
table.right {
margin-left: auto;
}
table.center {
margin-left: auto;
margin-right: auto;
}
caption {
caption-side: bottom;
font-weight: bold;
font-size: 9pt;
margin-top: .5em;
}
table.header {
border-spacing: 1px;
width: 95%;
font-size: 10pt;
color: white;
}
td.top {
vertical-align: top;
}
td.topnowrap {
vertical-align: top;
white-space: nowrap;
}
table.header td {
background-color: gray;
width: 50%;
}
table.header a {
color: white;
}
td.reference {
vertical-align: top;
white-space: nowrap;
padding-right: 1em;
}
thead {
display:table-header-group;
}
ul.toc, ul.toc ul {
list-style: none;
margin-left: 1.5em;
margin-right: 0em;
padding-left: 0em;
}
ul.toc li {
line-height: 150%;
font-weight: bold;
font-size: 10pt;
margin-left: 0em;
margin-right: 0em;
}
ul.toc li li {
line-height: normal;
font-weight: normal;
font-size: 9pt;
margin-left: 0em;
margin-right: 0em;
}
li.excluded {
font-size: 0pt;
}
ul p {
margin-left: 0em;
}
.comment {
background-color: yellow;
}
.center {
text-align: center;
}
.error {
color: red;
font-style: italic;
font-weight: bold;
}
.figure {
font-weight: bold;
text-align: center;
font-size: 9pt;
}
.filename {
color: #333333;
font-weight: bold;
font-size: 12pt;
line-height: 21pt;
text-align: center;
}
.fn {
font-weight: bold;
}
.hidden {
display: none;
}
.left {
text-align: left;
}
.right {
text-align: right;
}
.title {
color: #990000;
font-size: 18pt;
line-height: 18pt;
font-weight: bold;
text-align: center;
margin-top: 36pt;
}
.vcardline {
display: block;
}
.warning {
font-size: 14pt;
background-color: yellow;
}
@media print {
.noprint {
display: none;
}
a {
color: black;
text-decoration: none;
}
table.header {
width: 90%;
}
td.header {
width: 50%;
color: black;
background-color: white;
vertical-align: top;
font-size: 12pt;
}
ul.toc a::after {
content: leader('.') target-counter(attr(href), page);
}
ul.ind li li a {
content: target-counter(attr(href), page);
}
.print2col {
column-count: 2;
-moz-column-count: 2;
column-fill: auto;
}
}
@page {
@top-left {
content: "Internet-Draft";
}
@top-right {
content: "December 2010";
}
@top-center {
content: "Abbreviated Title";
}
@bottom-left {
content: "Doe";
}
@bottom-center {
content: "Expires June 2011";
}
@bottom-right {
content: "[Page " counter(page) "]";
}
}
@page:first {
@top-left {
content: normal;
}
@top-right {
content: normal;
}
@top-center {
content: normal;
}
}
/*]]>*/
</style>
<link href="#rfc.toc" rel="Contents"/>
<link href="#rfc.section.1" rel="Chapter" title="1 Introduction"/>
<link href="#rfc.section.2" rel="Chapter" title="2 Conventions and Terminology"/>
<link href="#rfc.section.3" rel="Chapter" title="3 Overview"/>
<link href="#rfc.section.3.1" rel="Chapter" title="3.1 Design Considerations"/>
<link href="#rfc.section.4" rel="Chapter" title="4 Schema keywords"/>
<link href="#rfc.section.4.1" rel="Chapter" title="4.1 links"/>
<link href="#rfc.section.4.1.1" rel="Chapter" title="4.1.1 Multiple links per URI"/>
<link href="#rfc.section.4.2" rel="Chapter" title="4.2 fragmentResolution"/>
<link href="#rfc.section.4.2.1" rel="Chapter" title="4.2.1 json-pointer fragment resolution"/>
<link href="#rfc.section.4.3" rel="Chapter" title="4.3 media"/>
<link href="#rfc.section.4.3.1" rel="Chapter" title="4.3.1 Properties of "media""/>
<link href="#rfc.section.4.3.2" rel="Chapter" title="4.3.2 Example"/>
<link href="#rfc.section.4.4" rel="Chapter" title="4.4 readOnly"/>
<link href="#rfc.section.4.5" rel="Chapter" title="4.5 pathStart"/>
<link href="#rfc.section.5" rel="Chapter" title="5 Link Description Object"/>
<link href="#rfc.section.5.1" rel="Chapter" title="5.1 href"/>
<link href="#rfc.section.5.1.1" rel="Chapter" title="5.1.1 URI Templating"/>
<link href="#rfc.section.5.2" rel="Chapter" title="5.2 rel"/>
<link href="#rfc.section.5.2.1" rel="Chapter" title="5.2.1 Fragment resolution with "root" links"/>
<link href="#rfc.section.5.2.2" rel="Chapter" title="5.2.2 Security Considerations for "self" links"/>
<link href="#rfc.section.5.3" rel="Chapter" title="5.3 title"/>
<link href="#rfc.section.5.4" rel="Chapter" title="5.4 targetSchema"/>
<link href="#rfc.section.5.4.1" rel="Chapter" title="5.4.1 Security Considerations for "targetSchema""/>
<link href="#rfc.section.5.5" rel="Chapter" title="5.5 mediaType"/>
<link href="#rfc.section.5.5.1" rel="Chapter" title="5.5.1 Security concerns for "mediaType""/>
<link href="#rfc.section.5.6" rel="Chapter" title="5.6 Submission Link Properties"/>
<link href="#rfc.section.5.6.1" rel="Chapter" title="5.6.1 method"/>
<link href="#rfc.section.5.6.2" rel="Chapter" title="5.6.2 encType"/>
<link href="#rfc.section.5.6.3" rel="Chapter" title="5.6.3 schema"/>
<link href="#rfc.section.6" rel="Chapter" title="6 IANA Considerations"/>
<link href="#rfc.section.6.1" rel="Chapter" title="6.1 Registry of Link Relations"/>
<link href="#rfc.references" rel="Chapter" title="7 References"/>
<link href="#rfc.references.1" rel="Chapter" title="7.1 Normative References"/>
<link href="#rfc.references.2" rel="Chapter" title="7.2 Informative References"/>
<link href="#rfc.appendix.A" rel="Chapter" title="A Change Log"/>
<link href="#rfc.authors" rel="Chapter"/>
<meta name="generator" content="xml2rfc version 2.5.1 - http://tools.ietf.org/tools/xml2rfc" />
<link rel="schema.dct" href="http://purl.org/dc/terms/" />
<meta name="dct.creator" content="Luff, G., Ed., Zyp, K., and G. Court" />
<meta name="dct.identifier" content="urn:ietf:id:draft-luff-json-hyper-schema-00" />
<meta name="dct.issued" scheme="ISO8601" content="2013" />
<meta name="dct.abstract" content="JSON Schema is a JSON based format for defining the structure of JSON data. This document specifies hyperlink- and hypermedia-related keywords of JSON Schema. " />
<meta name="description" content="JSON Schema is a JSON based format for defining the structure of JSON data. This document specifies hyperlink- and hypermedia-related keywords of JSON Schema. " />
{% if jekyll.environment == 'production' and site.google_analytics %}
{% include google-analytics.html %}
{% endif %}
</head>
<body>
<table class="header">
<tbody>
<tr>
<td class="left">Internet Engineering Task Force</td>
<td class="right">G. Luff, Ed.</td>
</tr>
<tr>
<td class="left">Internet-Draft</td>
<td class="right"></td>
</tr>
<tr>
<td class="left">Intended status: Informational</td>
<td class="right">K. Zyp</td>
</tr>
<tr>
<td class="left">Expires: August 26, 2017</td>
<td class="right">SitePen (USA)</td>
</tr>
<tr>
<td class="left"></td>
<td class="right">G. Court</td>
</tr>
<tr>
<td class="left"></td>
<td class="right">2013</td>
</tr>
</tbody>
</table>
<p class="title">JSON Hyper-Schema: Hypertext definitions for JSON Schema<br />
<span class="filename">draft-luff-json-hyper-schema-00</span></p>
<h1 id="rfc.abstract">
<a href="#rfc.abstract">Abstract</a>
</h1>
<p>JSON Schema is a JSON based format for defining the structure of JSON data. This document specifies hyperlink- and hypermedia-related keywords of JSON Schema. </p>
<h1 id="rfc.status">
<a href="#rfc.status">Status of This Memo</a>
</h1>
<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>
<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>
<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."</p>
<p>This Internet-Draft will expire on August 26, 2017.</p>
<h1 id="rfc.copyrightnotice">
<a href="#rfc.copyrightnotice">Copyright Notice</a>
</h1>
<p>Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.</p>
<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>
<hr class="noprint" />
<h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
<ul class="toc">
<li>1. <a href="#rfc.section.1">Introduction</a></li>
<li>2. <a href="#rfc.section.2">Conventions and Terminology</a></li>
<li>3. <a href="#rfc.section.3">Overview</a></li>
<ul><li>3.1. <a href="#rfc.section.3.1">Design Considerations</a></li>
</ul><li>4. <a href="#rfc.section.4">Schema keywords</a></li>
<ul><li>4.1. <a href="#rfc.section.4.1">links</a></li>
<ul><li>4.1.1. <a href="#rfc.section.4.1.1">Multiple links per URI</a></li>
</ul><li>4.2. <a href="#rfc.section.4.2">fragmentResolution</a></li>
<ul><li>4.2.1. <a href="#rfc.section.4.2.1">json-pointer fragment resolution</a></li>
</ul><li>4.3. <a href="#rfc.section.4.3">media</a></li>
<ul><li>4.3.1. <a href="#rfc.section.4.3.1">Properties of "media"</a></li>
<li>4.3.2. <a href="#rfc.section.4.3.2">Example</a></li>
</ul><li>4.4. <a href="#rfc.section.4.4">readOnly</a></li>
<li>4.5. <a href="#rfc.section.4.5">pathStart</a></li>
</ul><li>5. <a href="#rfc.section.5">Link Description Object</a></li>
<ul><li>5.1. <a href="#rfc.section.5.1">href</a></li>
<ul><li>5.1.1. <a href="#rfc.section.5.1.1">URI Templating</a></li>
</ul><li>5.2. <a href="#rfc.section.5.2">rel</a></li>
<ul><li>5.2.1. <a href="#rfc.section.5.2.1">Fragment resolution with "root" links</a></li>
<li>5.2.2. <a href="#rfc.section.5.2.2">Security Considerations for "self" links</a></li>
</ul><li>5.3. <a href="#rfc.section.5.3">title</a></li>
<li>5.4. <a href="#rfc.section.5.4">targetSchema</a></li>
<ul><li>5.4.1. <a href="#rfc.section.5.4.1">Security Considerations for "targetSchema"</a></li>
</ul><li>5.5. <a href="#rfc.section.5.5">mediaType</a></li>
<ul><li>5.5.1. <a href="#rfc.section.5.5.1">Security concerns for "mediaType"</a></li>
</ul><li>5.6. <a href="#rfc.section.5.6">Submission Link Properties</a></li>
<ul><li>5.6.1. <a href="#rfc.section.5.6.1">method</a></li>
<li>5.6.2. <a href="#rfc.section.5.6.2">encType</a></li>
<li>5.6.3. <a href="#rfc.section.5.6.3">schema</a></li>
</ul></ul><li>6. <a href="#rfc.section.6">IANA Considerations</a></li>
<ul><li>6.1. <a href="#rfc.section.6.1">Registry of Link Relations</a></li>
</ul><li>7. <a href="#rfc.references">References</a></li>
<ul><li>7.1. <a href="#rfc.references.1">Normative References</a></li>
<li>7.2. <a href="#rfc.references.2">Informative References</a></li>
</ul><li>Appendix A. <a href="#rfc.appendix.A">Change Log</a></li>
<li><a href="#rfc.authors">Authors' Addresses</a></li>
</ul>
<h1 id="rfc.section.1"><a href="#rfc.section.1">1.</a> Introduction</h1>
<p id="rfc.section.1.p.1">JSON Schema is a JSON based format for defining the structure of JSON data. This document specifies hyperlink- and hypermedia-related keywords of JSON Schema. </p>
<p id="rfc.section.1.p.2">The term JSON Hyper-Schema is used to refer to a JSON Schema that uses these keywords. </p>
<p id="rfc.section.1.p.3">This specification will use the terminology defined by the <a href="#json-schema-core">JSON Schema core specification</a> <cite title="NONE">[json-schema-core]</cite>. It is advised that readers have a copy of this specification. </p>
<h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> Conventions and Terminology</h1>
<p id="rfc.section.2.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <a href="#RFC2119">RFC 2119</a> <cite title="NONE">[RFC2119]</cite>. </p>
<p id="rfc.section.2.p.2">The terms "schema", "instance", "property" and "item" are to be interpreted as defined in the <a href="#json-schema-core">JSON Schema core specification</a> <cite title="NONE">[json-schema-core]</cite>. </p>
<h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> Overview</h1>
<p id="rfc.section.3.p.1">This document describes how JSON Schema can be used to define hyperlinks on instance data. It also defines how to provide additional information required to interpret JSON data as rich multimedia documents. </p>
<p id="rfc.section.3.p.2">Just as with the core JSON schema keywords, all the keywords described in the "Schema Keywords" section are optional. </p>
<p>Here is an example JSON Schema defining hyperlinks, and providing a multimedia interpretation for the "imgData" property:</p>
<pre>
{
"title": "Written Article",
"type": "object",
"properties": {
"id": {
"title": "Article Identifier",
"type": "number"
},
"title": {
"title": "Article Title",
"type": "string"
},
"authorId": {
"type": "integer"
},
"imgData": {
"title": "Article Illustration (small)",
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "image/png"
}
}
},
"required" : ["id", "title", "authorId"],
"links": [
{
"rel": "full",
"href": "{id}"
},
{
"rel": "author",
"href": "/user?id={authorId}"
}
]
}
</pre>
<p>This example schema defines the properties of the instance. For the "imgData" property, it specifies that that it should be base64-decoded and the resulting binary data treated as a PNG image. It also defines link relations for the instance, with URIs incorporating values from the instance. </p>
<p>An example of a JSON instance described by the above schema might be:</p>
<pre>
{
"id": 15,
"title": "Example data",
"authorId": 105,
"imgData": "iVBORw...kJggg=="
}
</pre>
<p>The base-64 data has been abbreviated for readability.</p>
<h1 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1.</a> Design Considerations</h1>
<p id="rfc.section.3.1.p.1">The purpose of this document is to define keywords for the JSON Schema that allow JSON data to be understood as hyper-text. </p>
<p id="rfc.section.3.1.p.2">JSON data on its own requires special knowledge from the client about the format in order to be interpretable as hyper-text. This document proposes a way to describe the hyper-text and hyper-media interpretation of such JSON formats, without defining reserved keywords or otherwise restricting the structure of the JSON data. </p>
<h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a> Schema keywords</h1>
<h1 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1.</a> links</h1>
<p id="rfc.section.4.1.p.1">The "links" property of schemas is used to associate Link Description Objects with instances. The value of this property MUST be an array, and the items in the array must be Link Description Objects, as defined below. </p>
<p>An example schema using the "links" keyword could be:</p>
<pre>
{
"title": "Schema defining links",
"links": [
{
"rel": "full",
"href": "{id}"
},
{
"rel": "parent",
"href": "{parent}"
}
]
}
</pre>
<h1 id="rfc.section.4.1.1"><a href="#rfc.section.4.1.1">4.1.1.</a> Multiple links per URI</h1>
<p id="rfc.section.4.1.1.p.1">A single URI might have more than one role with relation to an instance. This is not a problem - the same URI can be used in more than one Link Description Object. </p>
<p>For example, this schema describes a format for blog posts, accessed via HTTP. The links describe how to access the comments for the post, how to search the comments, and how to submit new comments, all with the same URI:</p>
<pre>
{
"title": "News post",
...
"links": [
{
"rel": "comments",
"href": "/{id}/comments"
},
{
"rel": "search",
"href": "/{id}/comments",
"schema": {
"type": "object",
"properties": {
"searchTerm": {
"type": "string"
},
"itemsPerPage": {
"type": "integer",
"minimum": 10,
"multipleOf": 10,
"default": 20
}
},
"required": ["searchTerm"]
}
},
{
"title": "Post a comment",
"rel": "create",
"href": "/{id}/comments",
"method": "POST",
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": ["message"]
}
}
]
}
</pre>
<p id="rfc.section.4.1.1.p.2">If the client follows the first link, the URI might be expanded to "/15/comments". For the second link, the method is "GET" (the default for HTTP) so a client following this link would add the parameters to the URL to produce something like: "/15/comments?searchTerm=JSON&itemsPerPage=50". The third link defines a possible interaction where a client would POST to a URI (such as "/15/comments"), where the post-data was a JSON representation of the new comment, for example: </p>
<pre>
{
"message": "This is an example comment"
}
</pre>
<h1 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2.</a> fragmentResolution</h1>
<p id="rfc.section.4.2.p.1">When addressing a JSON document, the fragment part of the URI may be used to refer to a particular instance within the document. </p>
<p id="rfc.section.4.2.p.2">This keyword indicates the method to use for finding the appropriate instance within a document, given the fragment part. The default fragment resolution protocol is "json-pointer", which is defined below. Other fragment resolution protocols MAY be used, but are not defined in this document. </p>
<p id="rfc.section.4.2.p.3">If the instance is described by a schema providing the a link with "root" relation, or such a link is provided in using the <a href="#RFC5988">HTTP Link header</a> <cite title="NONE">[RFC5988]</cite>, then the target of the "root" link should be considered the document root for the purposes of all fragment resolution methods that use the document structure (such as "json-pointer"). The only exception to this is the resolution of "root" links themselves. </p>
<h1 id="rfc.section.4.2.1"><a href="#rfc.section.4.2.1">4.2.1.</a> json-pointer fragment resolution</h1>
<p id="rfc.section.4.2.1.p.1">The "json-pointer" fragment resolution protocol uses a <a href="#json-pointer">JSON Pointer</a> <cite title="NONE">[json-pointer]</cite> to resolve fragment identifiers in URIs within instance representations. </p>
<h1 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3.</a> media</h1>
<p id="rfc.section.4.3.p.1">The "media" property indicates that this instance contains non-JSON data encoded in a JSON string. It describes the type of content and how it is encoded. </p>
<p id="rfc.section.4.3.p.2">The value of this property MUST be an object, and SHOULD be ignored for any instance that is not a string. </p>
<h1 id="rfc.section.4.3.1"><a href="#rfc.section.4.3.1">4.3.1.</a> Properties of "media"</h1>
<p id="rfc.section.4.3.1.p.1">The value of the "media" keyword MAY contain any of the following properties: </p>
<h1 id="rfc.section.4.3.1.1"><a href="#rfc.section.4.3.1.1">4.3.1.1.</a> binaryEncoding</h1>
<p id="rfc.section.4.3.1.1.p.1">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. <a href="#RFC2045">RFC 2045, Sec 6.1</a> <cite title="NONE">[RFC2045]</cite> lists the possible values for this property. </p>
<h1 id="rfc.section.4.3.1.2"><a href="#rfc.section.4.3.1.2">4.3.1.2.</a> type</h1>
<p id="rfc.section.4.3.1.2.p.1">The value of this property must be a media type, as defined by <a href="#RFC2046">RFC 2046</a> <cite title="NONE">[RFC2046]</cite>. This property defines the media type of instances which this schema defines. </p>
<p id="rfc.section.4.3.1.2.p.2">If the "binaryEncoding" property is not set, 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). </p>
<h1 id="rfc.section.4.3.2"><a href="#rfc.section.4.3.2">4.3.2.</a> Example</h1>
<p>Here is an example schema, illustrating the use of "media":</p>
<pre>
{
"type": "string",
"media": {
"binaryEncoding": "base64",
"type": "image/png"
}
}
</pre>
<p>Instances described by this schema should be strings, and their values should be interpretable as base64-encoded PNG images.</p>
<p>Another example:</p>
<pre>
{
"type": "string",
"media": {
"mediaType": "text/html"
}
}
</pre>
<p>Instances described by this schema should be strings containing HTML, using whatever character set the JSON string was decoded into (default is Unicode).</p>
<h1 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4.</a> readOnly</h1>
<p id="rfc.section.4.4.p.1">If it has a value of boolean true, this keyword indicates that the instance property SHOULD NOT be changed, and attempts by a user agent to modify the value of this property are expected to be rejected by a server. </p>
<p id="rfc.section.4.4.p.2">The value of this keyword MUST be a boolean. The default value is false. </p>
<h1 id="rfc.section.4.5"><a href="#rfc.section.4.5">4.5.</a> pathStart</h1>
<p id="rfc.section.4.5.p.1">This property is a URI that defines what the instance's URI MUST start with in order to validate. The value of the "pathStart" property MUST be resolved relative to the closest URI Resolution Scope (as defined in the <a href="#json-schema-core">JSON Schema core specification</a> <cite title="NONE">[json-schema-core]</cite>), using the rules from <a href="#RFC3986">RFC 3986, Sec 5</a> <cite title="NONE">[RFC3986]</cite>. </p>
<p id="rfc.section.4.5.p.2">When multiple schemas have been referenced for an instance, the user agent can determine if this schema is applicable for a particular instance by determining if the URI of the instance begins with the the value of the "pathStart" property. If the URI of the instance does not start with this URI, or if another schema specifies a starting URI that is longer and also matches the instance, this schema SHOULD NOT be considered to describe the instance. Any schema that does not have a pathStart property SHOULD be considered applicable to all the instances for which it is referenced. </p>
<h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a> Link Description Object</h1>
<p id="rfc.section.5.p.1">A Link Description Object (LDO) is used to describe a single link relation. In the context of a schema, it defines the link relations of the instances of the schema, and can be parameterized by the instance values. A Link Description Object (LDO) must be an object. </p>
<p id="rfc.section.5.p.2">The link description format can be used without JSON Schema, and use of this format can be declared by referencing the normative link description schema as the schema for the data structure that uses the links. The URI of the normative link description schema is: <a href="http://json-schema.org/links">http://json-schema.org/links</a> (latest version) or <a href="http://json-schema.org/draft-04/links">http://json-schema.org/draft-04/links</a> (draft-04 version). </p>
<p id="rfc.section.5.p.3">"Form"-like functionality can be defined by use of the "schema" keyword, which supplies a schema describing the data to supply to the server. </p>
<h1 id="rfc.section.5.1"><a href="#rfc.section.5.1">5.1.</a> <a href="#href" id="href">href</a></h1>
<p id="rfc.section.5.1.p.1">The value of the "href" link description property is a template used to determine the target URI of the related resource. The value of the instance property SHOULD be resolved as a URI-Reference per <a href="#RFC3986">RFC 3986</a> <cite title="NONE">[RFC3986]</cite> and MAY be a relative reference to a URI. The base URI to be used for relative URI resolution SHOULD be the URI used to retrieve the instance object (not the schema). </p>
<p id="rfc.section.5.1.p.2">The base URI to be used for relative URI resolution SHOULD is defined as follows: </p>
<ul class="empty">
<li>if the data has a link defined, with a relation of "self", then the "href" value of that link is used, unless the relation of the link being resolved is also "self"</li>
<li>otherwise, the URI should be resolved against the link with relation "self" belonging to the closest parent node in the JSON document, if it exists</li>
<li>otherwise, the URI used to fetch the document should be used.</li>
</ul>
<p> </p>
<p id="rfc.section.5.1.p.3">This property is not optional.</p>
<h1 id="rfc.section.5.1.1"><a href="#rfc.section.5.1.1">5.1.1.</a> URI Templating</h1>
<p id="rfc.section.5.1.1.p.1">The value of "href" is to be used as a URI Template, as defined in <a href="#RFC6570">RFC 6570</a> <cite title="NONE">[RFC6570]</cite>. However, some special considerations apply: </p>
<h1 id="rfc.section.5.1.1.1"><a href="#rfc.section.5.1.1.1">5.1.1.1.</a> Pre-processing</h1>
<p id="rfc.section.5.1.1.1.p.1">The <a href="#RFC6570">URI Template specification</a> <cite title="NONE">[RFC6570]</cite> restricts the set of characters available for variable names. Property names in JSON, however, can be any UTF-8 string. </p>
<p id="rfc.section.5.1.1.1.p.2">To allow the use of any JSON property name in the template, before using the value of "href" as a URI Template, the following pre-processing rules MUST be applied, in order: </p>
<h1 id="rfc.section.5.1.1.1.1"><a href="#rfc.section.5.1.1.1.1">5.1.1.1.1.</a> Bracket escaping</h1>
<p id="rfc.section.5.1.1.1.1.p.1">The purpose of this step is to allow the use of brackets to percent-encode variable names inside curly brackets. Variable names to be escaped are enclosed within rounded brackets, with the close-rounded-bracket character ")" being escaped as a pair of close-rounded-brackets "))". Since the empty string is not a valid variable name in RFC 6570, an empty pair of brackets is replaced with "%65mpty". </p>
<p id="rfc.section.5.1.1.1.1.p.2">The rules are as follows: </p>
<p id="rfc.section.5.1.1.1.1.p.3">Find the largest possible sections of the text such that: </p>
<ul class="empty">
<li>do not contain an odd number of close-rounded-bracket characters ")" in sequence in that section of the text</li>
<li>are surrounded by a pair of rounded brackets: ( ), where</li>
<li>the surrounding rounded brackets are themselves contained within a pair of curly brackets: { }</li>
</ul>
<p> </p>
<p id="rfc.section.5.1.1.1.1.p.4">Each of these sections of the text (including the surrounding rounded brackets) MUST be replaced, according to the following rules: </p>
<ul class="empty">
<li>If the brackets contained no text (the empty string), then they are replaced with "%65mpty" (which is "empty" with a percent-encoded "e")</li>
<li>Otherwise, the enclosing brackets are removed, and the inner text used after the following modifications <ul class="empty"><li>all pairs of close-brackets "))" are replaced with a single close bracket</li><li>after that, the text is replaced with its percent-encoded equivalent, such that the result is a valid RFC 6570 variable name (note that this requires encoding characters such as "*" and "!")</li></ul><p> </p></li>
</ul>
<p> </p>
<h1 id="rfc.section.5.1.1.1.2"><a href="#rfc.section.5.1.1.1.2">5.1.1.1.2.</a> Replacing $</h1>
<p id="rfc.section.5.1.1.1.2.p.1">After the above substitutions, if the character "$" (dollar sign) appears within a pair of curly brackets, then it MUST be replaced with the text "%73elf" (which is "self" with a percent-encoded "s"). </p>
<p id="rfc.section.5.1.1.1.2.p.2">The purpose of this stage is to allow the use of the instance value itself (instead of its object properties or array items) in the URI Template, by the special value "%73elf". </p>
<h1 id="rfc.section.5.1.1.1.3"><a href="#rfc.section.5.1.1.1.3">5.1.1.1.3.</a> Choice of special-case values</h1>
<p id="rfc.section.5.1.1.1.3.p.1">The special-case values of "%73elf" and "%65mpty" were chosen because they are unlikely to be accidentally generated by either a human or automated escaping. </p>
<h1 id="rfc.section.5.1.1.1.4"><a href="#rfc.section.5.1.1.1.4">5.1.1.1.4.</a> Examples</h1>
<p/>
<p>For example, here are some possible values for "href", followed by the results after pre-processing:</p>
<pre>
{% raw %}
Input Output
-----------------------------------------
"no change" "no change"
"(no change)" "(no change)"
"{(escape space)}" "{escape%20space}"
"{(escape+plus)}" "{escape%2Bplus}"
"{(escape*asterisk)}" "{escape%2Aasterisk}"
"{(escape(bracket)}" "{escape%28bracket}"
"{(escape))bracket)}" "{escape%29bracket}"
"{(a))b)}" "{a%29b}
"{(a (b)))}" "{a%20%28b%29}
"{()}" "{%65mpty}
"{+$*}" "{+%73elf*}
"{+($)*}" "{+%24*}
{% endraw %}
</pre>
<p>Note that in the final example, because the "+" was outside the brackets, it remained unescaped, whereas in the fourth example the "+" was escaped. </p>
<h1 id="rfc.section.5.1.1.2"><a href="#rfc.section.5.1.1.2">5.1.1.2.</a> Values for substitution</h1>
<p id="rfc.section.5.1.1.2.p.1">After pre-processing, the URI Template is filled out using data from the instance. To allow the use of any object property (including the empty string), array index, or the instance value itself, the following rules are defined: </p>
<p id="rfc.section.5.1.1.2.p.2">For a given variable name in the URI Template, the value to use is determined as follows: </p>
<ul class="empty">
<li>If the variable name is "%73elf", then the instance value itself MUST be used.</li>
<li>If the variable name is "%65mpty", then the instances's empty-string ("") property MUST be used (if it exists).</li>
<li>If the instance is an array, and the variable name is a representation of a non-negative integer, then the value at the corresponding array index MUST be used (if it exists).</li>
<li>Otherwise, the variable name should be percent-decoded, and the corresponding object property MUST be used (if it exists).</li>
</ul>
<p> </p>
<h1 id="rfc.section.5.1.1.2.1"><a href="#rfc.section.5.1.1.2.1">5.1.1.2.1.</a> Converting to strings</h1>
<p id="rfc.section.5.1.1.2.1.p.1">When any value referenced by the URI template is null, a boolean or a number, then it should first be converted into a string as follows: </p>
<ul class="empty">
<li>null values SHOULD be replaced by the text "null"</li>
<li>boolean values SHOULD be replaced by their lower-case equivalents: "true" or "false"</li>
<li>numbers SHOULD be replaced with their original JSON representation.</li>
</ul>
<p> </p>
<p id="rfc.section.5.1.1.2.1.p.2">In some software environments the original JSON representation of a number will not be available (there is no way to tell the difference between 1.0 and 1), so any reasonable representation should be used. Schema and API authors should bear this in mind, and use other types (such as string or boolean) if the exact representation is important. </p>
<h1 id="rfc.section.5.1.1.3"><a href="#rfc.section.5.1.1.3">5.1.1.3.</a> Missing values</h1>
<p id="rfc.section.5.1.1.3.p.1">Sometimes, the appropriate values will not be available. For example, the template might specify the use of object properties, but the instance is an array or a string. </p>
<p id="rfc.section.5.1.1.3.p.2">If any of the values required for the template are not present in the JSON instance, then substitute values MAY be provided from another source (such as default values). Otherwise, the link definition SHOULD be considered not to apply to the instance. </p>
<h1 id="rfc.section.5.2"><a href="#rfc.section.5.2">5.2.</a> rel</h1>
<p id="rfc.section.5.2.p.1">The value of the "rel" property indicates the name of the relation to the target resource. This property is not optional. </p>
<p id="rfc.section.5.2.p.2">The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. A link relation from the top level resource to a target MUST be indicated with the schema describing the top level JSON representation. </p>
<p id="rfc.section.5.2.p.3">Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see <a href="#RFC4287">RFC 4287</a> <cite title="NONE">[RFC4287]</cite>). However, we define these relations here for clarity of normative interpretation within the context of JSON Schema defined relations: </p>
<dl>
<dt>self</dt>
<dd style="margin-left: 8">If the relation value is "self", when this property is encountered in the instance object, the object represents a resource and the instance object is treated as a full representation of the target resource identified by the specified URI. </dd>
<dt>full</dt>
<dd style="margin-left: 8">This indicates that the target of the link is the full representation for the instance object. The instance that contains this link may not be the full representation. </dd>
<dt>describedBy</dt>
<dd style="margin-left: 8">This indicates the target of the link is a schema describing the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. </dd>
<dt>root</dt>
<dd style="margin-left: 8">This relation indicates that the target of the link SHOULD be treated as the root or the body of the representation for the purposes of user agent interaction or fragment resolution. All other data in the document can be regarded as meta-data for the document. The URI of this link MUST refer to a location within the instance document, otherwise the link MUST be ignored. </dd>
</dl>
<p> </p>
<p id="rfc.section.5.2.p.4">The following relations are applicable for schemas (the schema as the "from" resource in the relation) if they require no parameterization with data from the instance: </p>
<dl>
<dt>instances</dt>
<dd style="margin-left: 8">This indicates the target resource that represents a collection of instances of a schema. </dd>
<dt>create</dt>
<dd style="margin-left: 8">This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). </dd>
</dl>
<p> </p>
<p>For example, if a schema is defined:</p>
<pre>
{
"links": [{
"rel": "self",
"href": "{id}"
}, {
"rel": "up",
"href": "{upId}"
}, {
"rel": "children",
"href": "?upId={id}"
}]
}
</pre>
<p>And if a collection of instance resources were retrieved with JSON representation:</p>
<pre>
GET /Resource/
[{
"id": "thing",
"upId": "parent"
}, {
"id": "thing2",
"upId": "parent"
}]
</pre>
<p>This would indicate that for the first item in the collection, its own (self) URI would resolve to "/Resource/thing" and the first item's "up" relation SHOULD be resolved to the resource at "/Resource/parent". The "children" collection would be located at "/Resource/?upId=thing". </p>
<p id="rfc.section.5.2.p.5">Note that these relationship values are case-insensitive, consistent with their use in HTML and the <a href="#RFC5988">HTTP Link header</a> <cite title="NONE">[RFC5988]</cite>. </p>
<h1 id="rfc.section.5.2.1"><a href="#rfc.section.5.2.1">5.2.1.</a> Fragment resolution with "root" links</h1>
<p id="rfc.section.5.2.1.p.1">The presence of a link with relation "root" alters what the root of the document is considered to be. For fragment resolution methods (such as JSON Pointer fragments) that navigate through the document, the target of the "root" link should be the starting point for such methods. </p>
<p id="rfc.section.5.2.1.p.2">The only exception is "root" links themselves. When calculating the target of links with relation "root", existing "root" links MUST NOT be taken into consideration. </p>
<p/>
<p>For example, say we have the following schema:</p>
<pre>
{
"links": [{
"rel": "root",
"href": "#/myRootData"
}]
}
</pre>
<p/>
<p>And the following data, returned from the URI: "http://example.com/data/12345":</p>
<pre>
{
"myRootData": {
"title": "Document title"
},
"metaData": {
...
}
}
</pre>
<pre>
URI Data
-----------------------------------------------------------------------
http://example.com/data/12345 {"title": "Document title"}
http://example.com/data/12345#/title "Document title"
</pre>
<p id="rfc.section.5.2.1.p.5">To correctly resolve the URL "http://example.com/data/12345", we must take the "root" link into account. Here are some example URIs, along with the data they would resolve to: </p>
<h1 id="rfc.section.5.2.2"><a href="#rfc.section.5.2.2">5.2.2.</a> Security Considerations for "self" links</h1>
<p id="rfc.section.5.2.2.p.1">When link relation of "self" is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not equivalent to or a sub-path of the the URI used to request the resource representation which contains the target URI with the "self" link. </p>
<p>For example, if a hyper schema was defined:</p>
<pre>
{
"links": [{
"rel": "self",
"href": "{id}"
}]
}
</pre>
<p>And a resource was requested from somesite.com:</p>
<pre>
GET /foo/
</pre>
<p>With a response of:</p>
<pre>
Content-Type: application/json; profile=/schema-for-this-data
[{
"id": "bar",
"name": "This representation can be safely treated \
as authoritative "
}, {
"id": "/baz",
"name": "This representation should not be treated as \
authoritative the user agent should make request the resource\
from '/baz' to ensure it has the authoritative representation"
}, {
"id": "http://othersite.com/something",
"name": "This representation\
should also not be treated as authoritative and the target\
resource representation should be retrieved for the\
authoritative representation"
}]
</pre>
<h1 id="rfc.section.5.3"><a href="#rfc.section.5.3">5.3.</a> title</h1>
<p id="rfc.section.5.3.p.1">This property defines a title for the link. The value must be a string. </p>
<p id="rfc.section.5.3.p.2">User agents MAY use this title when presenting the link to the user. </p>
<h1 id="rfc.section.5.4"><a href="#rfc.section.5.4">5.4.</a> targetSchema</h1>
<p id="rfc.section.5.4.p.1">This property value is advisory only, and is a schema that defines the expected structure of the JSON representation of the target of the link, if the target of the link is returned using JSON representation. </p>
<h1 id="rfc.section.5.4.1"><a href="#rfc.section.5.4.1">5.4.1.</a> Security Considerations for "targetSchema"</h1>
<p id="rfc.section.5.4.1.p.1">This property has similar security concerns to that of "mediaType". Clients MUST NOT use the value of this property to aid in the interpretation of the data received in response to following the link, as this leaves "safe" data open to re-interpretation. </p>
<p/>
<p>For example, suppose two programmers are having a discussion about web security using a text-only message board. Here is some data from that conversation, with a URI of: http://forum.example.com/topics/152/comments/13 </p>
<pre>
{
"topicId": 152,
"commentId": 13,
"from": {
"name": "Jane",
"id": 5
},
"to": {
"name": "Jason",
"id": 8
},
"message": "It's easy, you just add some HTML like
this: <script>doSomethingEvil()</script>"
}
</pre>
<p>The message string was split over two lines for readability. </p>
<pre>
{
"rel": "evil-attack",
"href": "http://forum.example.com/topics/152/comments/13",
"targetSchema": {
"properties": {
"message": {
"description": "Re-interpret the message text as HTML",
"media": {
"type": "text/html"
}
}
}
}
}
</pre>
<p id="rfc.section.5.4.1.p.3">A third party might then write provide the following Link Description Object at another location: </p>
<p>If the client used this "targetSchema" value when interpreting the above data, then it might display the contents of "message" as HTML. At this point, the JavaScript embedded in the message might be executed (in the context of the "forum.example.com" domain). </p>
<h1 id="rfc.section.5.5"><a href="#rfc.section.5.5">5.5.</a> mediaType</h1>
<p id="rfc.section.5.5.p.1">The value of this property is advisory only, and represents the media type <a href="#RFC2046">RFC 2046</a> <cite title="NONE">[RFC2046]</cite>, that is expected to be returned when fetching this resource. This property value MAY be a media range instead, using the same pattern defined in <a href="#RFC2616">RFC 2161, section 14.1 - HTTP "Accept" header</a> <cite title="NONE">[RFC2616]</cite>. </p>
<p id="rfc.section.5.5.p.2">This property is analogous to the "type" property of <a> elements in HTML (advisory content type), or the "type" parameter in the <a href="#RFC5988">HTTP Link header</a> <cite title="NONE">[RFC5988]</cite>. User agents MAY use this information to inform the interface they present to the user before the link is followed, but this information MUST NOT use this information in the interpretation of the resulting data. When deciding how to interpret data obtained through following this link, the behaviour of user agents MUST be identical regardless of the value of the this property. </p>
<p id="rfc.section.5.5.p.3">If this property's value is specified, and the link's target is to be obtained using any protocol that supports the HTTP/1.1 "Accept" header <a href="#RFC2616">RFC 2616, section 14.1</a> <cite title="NONE">[RFC2616]</cite>, then user agents MAY use the value of this property to aid in the assembly of that header when making the request to the server. </p>
<p id="rfc.section.5.5.p.4">If this property's value is not specified, then the value should be taken to be "application/json". </p>
<p>For example, if a schema is defined:</p>
<pre>