-
Notifications
You must be signed in to change notification settings - Fork 9.1k
/
Copy pathv2.0.html
3627 lines (3563 loc) · 251 KB
/
v2.0.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><html lang="en"><head>
<meta charset="UTF-8">
<meta name="generator" content="ReSpec 35.3.0">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style>
dfn{cursor:pointer}
.dfn-panel{position:absolute;z-index:35;min-width:300px;max-width:500px;padding:.5em .75em;margin-top:.6em;font-family:"Helvetica Neue",sans-serif;font-size:small;background:#fff;background:var(--indextable-hover-bg,#fff);color:#000;color:var(--text,#000);box-shadow:0 1em 3em -.4em rgba(0,0,0,.3),0 0 1px 1px rgba(0,0,0,.05);box-shadow:0 1em 3em -.4em var(--tocsidebar-shadow,rgba(0,0,0,.3)),0 0 1px 1px var(--tocsidebar-shadow,rgba(0,0,0,.05));border-radius:2px}
.dfn-panel:not(.docked)>.caret{position:absolute;top:-9px}
.dfn-panel:not(.docked)>.caret::after,.dfn-panel:not(.docked)>.caret::before{content:"";position:absolute;border:10px solid transparent;border-top:0;border-bottom:10px solid #fff;border-bottom-color:var(--indextable-hover-bg,#fff);top:0}
.dfn-panel:not(.docked)>.caret::before{border-bottom:9px solid #a2a9b1;border-bottom-color:var(--indextable-hover-bg,#a2a9b1)}
.dfn-panel *{margin:0}
.dfn-panel b{display:block;color:#000;color:var(--text,#000);margin-top:.25em}
.dfn-panel ul a[href]{color:#333;color:var(--text,#333)}
.dfn-panel>div{display:flex}
.dfn-panel a.self-link{font-weight:700;margin-right:auto}
.dfn-panel .marker{padding:.1em;margin-left:.5em;border-radius:.2em;text-align:center;white-space:nowrap;font-size:90%;color:#040b1c}
.dfn-panel .marker.dfn-exported{background:#d1edfd;box-shadow:0 0 0 .125em #1ca5f940}
.dfn-panel .marker.idl-block{background:#8ccbf2;box-shadow:0 0 0 .125em #0670b161}
.dfn-panel a:not(:hover){text-decoration:none!important;border-bottom:none!important}
.dfn-panel a[href]:hover{border-bottom-width:1px}
.dfn-panel ul{padding:0}
.dfn-panel li{margin-left:1em}
.dfn-panel.docked{position:fixed;left:.5em;top:unset;bottom:2em;margin:0 auto;max-width:calc(100vw - .75em * 2 - .5em - .2em * 2);max-height:30vh;overflow:auto}
</style>
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-831873-42"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-831873-42');
</script>
<title>OpenAPI Specification v2.0</title>
<meta name="description" content="The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.">
<meta name="color-scheme" content="light dark">
<style id="respec-mainstyle">
@keyframes pop{
0%{transform:scale(1,1)}
25%{transform:scale(1.25,1.25);opacity:.75}
100%{transform:scale(1,1)}
}
a.internalDFN{color:inherit;border-bottom:1px solid #99c;text-decoration:none}
a.externalDFN{color:inherit;border-bottom:1px dotted #ccc;text-decoration:none}
a.bibref{text-decoration:none}
.respec-offending-element:target{animation:pop .25s ease-in-out 0s 1}
.respec-offending-element,a[href].respec-offending-element{text-decoration:red wavy underline}
@supports not (text-decoration:red wavy underline){
.respec-offending-element:not(pre){display:inline-block}
.respec-offending-element{background:url(data:image/gif;base64,R0lGODdhBAADAPEAANv///8AAP///wAAACwAAAAABAADAEACBZQjmIAFADs=) bottom repeat-x}
}
#references :target{background:#eaf3ff;animation:pop .4s ease-in-out 0s 1}
cite .bibref{font-style:normal}
a[href].orcid{padding-left:4px;padding-right:4px}
a[href].orcid>svg{margin-bottom:-2px}
ol.tof,ul.tof{list-style:none outside none}
.caption{margin-top:.5em;font-style:italic}
#issue-summary>ul{column-count:2}
#issue-summary li{list-style:none;display:inline-block}
details.respec-tests-details{margin-left:1em;display:inline-block;vertical-align:top}
details.respec-tests-details>*{padding-right:2em}
details.respec-tests-details[open]{z-index:999999;position:absolute;border:thin solid #cad3e2;border-radius:.3em;background-color:#fff;padding-bottom:.5em}
details.respec-tests-details[open]>summary{border-bottom:thin solid #cad3e2;padding-left:1em;margin-bottom:1em;line-height:2em}
details.respec-tests-details>ul{width:100%;margin-top:-.3em}
details.respec-tests-details>li{padding-left:1em}
.self-link:hover{opacity:1;text-decoration:none;background-color:transparent}
aside.example .marker>a.self-link{color:inherit}
.header-wrapper{display:flex;align-items:baseline}
:is(h2,h3,h4,h5,h6):not(#toc>h2,#abstract>h2,#sotd>h2,.head>h2){position:relative;left:-.5em}
:is(h2,h3,h4,h5,h6):not(#toch2)+a.self-link{color:inherit;order:-1;position:relative;left:-1.1em;font-size:1rem;opacity:.5}
:is(h2,h3,h4,h5,h6)+a.self-link::before{content:"§";text-decoration:none;color:var(--heading-text)}
:is(h2,h3)+a.self-link{top:-.2em}
:is(h4,h5,h6)+a.self-link::before{color:#000}
@media (max-width:767px){
dd{margin-left:0}
}
@media print{
.removeOnSave{display:none}
}
</style>
<link rel="canonical" href="https://spec.openapis.org/oas/v2.0.html">
<style>
var:hover{text-decoration:underline;cursor:pointer}
var.respec-hl{color:var(--color,#000);background-color:var(--bg-color);box-shadow:0 0 0 2px var(--bg-color)}
@media (prefers-color-scheme:dark){
var.respec-hl{filter:saturate(.9) brightness(.9)}
}
var.respec-hl-c1{--bg-color:#f4d200}
var.respec-hl-c2{--bg-color:#ff87a2}
var.respec-hl-c3{--bg-color:#96e885}
var.respec-hl-c4{--bg-color:#3eeed2}
var.respec-hl-c5{--bg-color:#eacfb6}
var.respec-hl-c6{--bg-color:#82ddff}
var.respec-hl-c7{--bg-color:#ffbcf2}
@media print{
var.respec-hl{background:0 0;color:#000;box-shadow:unset}
}
</style>
<style>
var{position:relative;cursor:pointer}
var[data-type]::after,var[data-type]::before{position:absolute;left:50%;top:-6px;opacity:0;transition:opacity .4s;pointer-events:none}
var[data-type]::before{content:"";transform:translateX(-50%);border-width:4px 6px 0 6px;border-style:solid;border-color:transparent;border-top-color:#222}
var[data-type]::after{content:attr(data-type);transform:translateX(-50%) translateY(-100%);background:#222;text-align:center;font-family:"Dank Mono","Fira Code",monospace;font-style:normal;padding:6px;border-radius:3px;color:#daca88;text-indent:0;font-weight:400}
var[data-type]:hover::after,var[data-type]:hover::before{opacity:1}
</style>
<script id="initialUserConfig" type="application/json">{
"specStatus": "base",
"latestVersion": "https://spec.openapis.org/oas/latest.html",
"thisVersion": "https://spec.openapis.org/oas/v2.0.html",
"canonicalURI": "https://spec.openapis.org/oas/v2.0.html",
"editors": [
{
"name": "Jeremy Whitlock "
},
{
"name": "Marsh Gardiner "
},
{
"name": "Ron Ratovsky "
},
{
"name": "Tony Tam "
}
],
"formerEditors": [],
"publishDate": "2014-09-08T00:00:00.000Z",
"subtitle": "Version 2.0",
"edDraftURI": "https://github.com/OAI/OpenAPI-Specification/",
"shortName": "OAS",
"historyURI": null,
"lint": false,
"logos": [
{
"src": "https://raw.githubusercontent.com/OAI/OpenAPI-Style-Guide/master/graphics/bitmap/OpenAPI_Logo_Pantone.png",
"alt": "OpenAPI Initiative",
"height": 48,
"url": "https://openapis.org/"
}
],
"otherLinks": [
{
"key": "Other versions:",
"data": [
{
"href": "https://spec.openapis.org/oas/v3.1.1.html"
},
{
"href": "https://spec.openapis.org/oas/v3.1.0.html"
},
{
"href": "https://spec.openapis.org/oas/v3.0.4.html"
},
{
"href": "https://spec.openapis.org/oas/v3.0.3.html"
},
{
"href": "https://spec.openapis.org/oas/v3.0.2.html"
},
{
"href": "https://spec.openapis.org/oas/v3.0.1.html"
},
{
"href": "https://spec.openapis.org/oas/v3.0.0.html"
}
]
},
{
"key": "Participate",
"data": [
{
"value": "GitHub OAI/OpenAPI-Specification",
"href": "https://github.com/OAI/OpenAPI-Specification/"
},
{
"value": "File a bug",
"href": "https://github.com/OAI/OpenAPI-Specification/issues"
},
{
"value": "Commit history",
"href": "https://github.com/OAI/OpenAPI-Specification/commits/main/versions/2.0.md"
},
{
"value": "Pull requests",
"href": "https://github.com/OAI/OpenAPI-Specification/pulls"
}
]
}
],
"publishISODate": "2014-09-08T00:00:00.000Z",
"generatedSubtitle": "08 September 2014"
}</script>
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2021/base.css">
<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="https://www.w3.org/StyleSheets/TR/2021/dark.css"></head>
<body class="h-entry"><div class="head">
<p class="logos"><a class="logo" href="https://openapis.org/"><img crossorigin="" alt="OpenAPI Initiative" height="48" src="https://raw.githubusercontent.com/OAI/OpenAPI-Style-Guide/master/graphics/bitmap/OpenAPI_Logo_Pantone.png">
</a></p>
<h1 id="title" class="title">OpenAPI Specification v2.0 </h1> <h2 id="subtitle" class="subtitle">Version 2.0</h2>
<p id="w3c-state"> <time class="dt-published" datetime="2014-09-08">08 September 2014</time></p>
<details open="">
<summary>More details about this document</summary>
<dl>
<dt>This version:</dt><dd>
<a class="u-url" href="https://spec.openapis.org/oas/v2.0.html">https://spec.openapis.org/oas/v2.0.html</a>
</dd>
<dt>Latest published version:</dt><dd>
<a href="https://spec.openapis.org/oas/latest.html">https://spec.openapis.org/oas/latest.html</a>
</dd>
<dt>Latest editor's draft:</dt><dd><a href="https://github.com/OAI/OpenAPI-Specification/">https://github.com/OAI/OpenAPI-Specification/</a></dd>
<dt>Editors:</dt><dd class="editor p-author h-card vcard">
<span class="p-name fn">Jeremy Whitlock </span>
</dd><dd class="editor p-author h-card vcard">
<span class="p-name fn">Marsh Gardiner </span>
</dd><dd class="editor p-author h-card vcard">
<span class="p-name fn">Ron Ratovsky </span>
</dd><dd class="editor p-author h-card vcard">
<span class="p-name fn">Tony Tam </span>
</dd>
<dt>Other versions:</dt><dd>
<a href="https://spec.openapis.org/oas/v3.1.1.html">https://spec.openapis.org/oas/v3.1.1.html</a>
</dd><dd>
<a href="https://spec.openapis.org/oas/v3.1.0.html">https://spec.openapis.org/oas/v3.1.0.html</a>
</dd><dd>
<a href="https://spec.openapis.org/oas/v3.0.4.html">https://spec.openapis.org/oas/v3.0.4.html</a>
</dd><dd>
<a href="https://spec.openapis.org/oas/v3.0.3.html">https://spec.openapis.org/oas/v3.0.3.html</a>
</dd><dd>
<a href="https://spec.openapis.org/oas/v3.0.2.html">https://spec.openapis.org/oas/v3.0.2.html</a>
</dd><dd>
<a href="https://spec.openapis.org/oas/v3.0.1.html">https://spec.openapis.org/oas/v3.0.1.html</a>
</dd><dd>
<a href="https://spec.openapis.org/oas/v3.0.0.html">https://spec.openapis.org/oas/v3.0.0.html</a>
</dd><dt>Participate</dt><dd>
<a href="https://github.com/OAI/OpenAPI-Specification/">GitHub OAI/OpenAPI-Specification</a>
</dd><dd>
<a href="https://github.com/OAI/OpenAPI-Specification/issues">File a bug</a>
</dd><dd>
<a href="https://github.com/OAI/OpenAPI-Specification/commits/main/versions/2.0.md">Commit history</a>
</dd><dd>
<a href="https://github.com/OAI/OpenAPI-Specification/pulls">Pull requests</a>
</dd>
</dl>
</details>
<p class="copyright">Copyright © 2014 the Linux Foundation</p>
<hr title="Separator for header">
</div><style>
#respec-ui { visibility: hidden; } #title { color: #578000; } #subtitle { color: #578000; } .dt-published { color: #578000; } .dt-published::before { content: "Published "; } h1, h2, h3, h4, h5, h6 { color: #578000; font-weight: normal; font-style: normal; } a[href] { color: #45512c; } body:not(.toc-inline) #toc h2 { color: #45512c; } table { display: block; width: 100%; overflow: auto; } table th { font-weight: 600; } table th, table td { padding: 6px 13px; border: 1px solid #dfe2e5; } table tr { background-color: #fff; border-top: 1px solid #c6cbd1; } table tr:nth-child(2n) { background-color: #f6f8fa; } pre { background-color: #f6f8fa !important; } code { color: #c83500 } th code { color: inherit } a.bibref { text-decoration: underline; } body.darkmode { --toclink-underline: #6a9000; --toclink-visited-underline: #fff; } body.darkmode a, body.darkmode .tocxref, body.darkmode .u-url { color: #6a9000; } body.darkmode code { color: #e66c33; } body.darkmode:not(.toc-inline) #toc h2, body.darkmode h1, body.darkmode h2, body.darkmode h3, body.darkmode h4, body.darkmode h5, body.darkmode h6, body.darkmode #title, body.darkmode #subtitle, body.darkmode .toc-inline, body.darkmode .dt-published { color: #7bb01c; } body.darkmode pre, body.darkmode table tr:nth-child(2n), body.darkmode table tr { background-color: #1e1e1e !important; color: #dcdcdc; } body.darkmode img { background: transparent; } body.darkmode .logo img { display: none; } body.darkmode .logo::before { content: ""; display: inline-block; height: 48px; width: 175px; background: url("https://raw.githubusercontent.com/OAI/OpenAPI-Style-Guide/refs/heads/main/graphics/bitmap/OpenAPI_Logo_Pantone.png") no-repeat center / contain; vertical-align: middle; } /** This contains the content of the https://www.w3.org/StyleSheets/TR/2021/dark.css file */ body.darkmode { --text: #ddd; --bg: black; /* Absolute URLs due to https://bugs.webkit.org/show_bug.cgi?id=230243 */ --unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2021/logos/UD-watermark-dark-unofficial); --draft-watermark: url(https://www.w3.org/StyleSheets/TR/2021/logos/UD-watermark-dark-draft); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #999; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #080808; --tocnav-active-text: #f44; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #080808; --tocsidebar-shadow: rgba(255,255,255,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #6af; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #8af; --hr-text: var(--text); --algo-border: #456; --del-text: #f44; --del-bg: transparent; --ins-text: #4a4; --ins-bg: transparent; --a-normal-text: #6af; --a-normal-underline: #555; --a-visited-text: var(--a-normal-text); --a-visited-underline: var(--a-normal-underline); --a-hover-bg: rgba(25%, 25%, 25%, .2); --a-active-text: #f44; --a-active-underline: var(--a-active-text); --borderedblock-bg: rgba(255, 255, 255, .05); --blockquote-border: silver; --blockquote-bg: var(--borderedblock-bg); --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: var(--borderedblock-bg); --issue-text: var(--text); --issueheading-text: hsl(0deg, 70%, 70%); --example-border: hsl(50deg, 90%, 60%); --example-bg: var(--borderedblock-bg); --example-text: var(--text); --exampleheading-text: hsl(50deg, 70%, 70%); --note-border: hsl(120deg, 100%, 35%); --note-bg: var(--borderedblock-bg); --note-text: var(--text); --noteheading-text: hsl(120, 70%, 70%); --notesummary-underline: silver; --advisement-border: orange; --advisement-bg: #222218; --advisement-text: var(--text); --advisementheading-text: #f84; --amendment-border: #330099; --amendment-bg: var(--borderedblock-bg); --amendment-text: var(--text); --amendmentheading-text: #a086ff; --amendment-border: #330099; --amendment-bg: #080010; --amendment-text: var(--text); --amendmentheading-text: #cc00ff; --warning-border: red; --warning-bg: hsla(40,100%,20%,0.95); --warning-text: var(--text); --def-border: #8ccbf2; --def-bg: #080818; --def-text: var(--text); --defrow-border: #136; --datacell-border: silver; --indexinfo-text: #aaa; --indextable-hover-text: var(--text); --indextable-hover-bg: #181818; --outdatedspec-bg: rgba(255, 255, 255, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; }/** * GitHub Gist Theme * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro */ .hljs { display: block; background: white; padding: 0.5em; color: #333333; overflow-x: auto; } .hljs-comment, .hljs-meta { color: #727070; } .hljs-string, .hljs-variable, .hljs-template-variable, .hljs-strong, .hljs-emphasis, .hljs-quote { color: #c74700; } .hljs-number { color: #005e5e; } .hljs-keyword, .hljs-selector-tag, .hljs-type { color: #a71d5d; } .hljs-literal, .hljs-symbol, .hljs-bullet, .hljs-attribute { color: #007aa2; } .hljs-section, .hljs-name { color: #4b7c46; } .hljs-tag { color: #333333; } .hljs-title, .hljs-attr, .hljs-selector-id, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo { color: #795da3; } .hljs-addition { color: #55a532; background-color: #eaffea; } .hljs-deletion { color: #bd2c00; background-color: #ffecec; } .hljs-link { text-decoration: underline; }
</style><section class="notoc introductory" id="abstract"><h2>What is the OpenAPI Specification?</h2>The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.</section><section class="override introductory notoc" id="sotd" data-max-toc="0"><h2>Status of This Document</h2>The source-of-truth for this specification is the HTML file referenced above as <em>This version</em>.</section><nav id="toc"><h2 class="introductory" id="table-of-contents">Table of Contents</h2><ol class="toc"><li class="tocline"><a class="tocxref" href="#openapi-specification"><bdi class="secno">1. </bdi>OpenAPI Specification</a></li><li class="tocline"><a class="tocxref" href="#fka-swagger-restful-api-documentation-specification"><bdi class="secno">2. </bdi>(fka Swagger RESTful API Documentation Specification)</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#conformance"><bdi class="secno">2.1 </bdi>Version 2.0</a></li></ol></li><li class="tocline"><a class="tocxref" href="#introductions"><bdi class="secno">3. </bdi>Introductions</a></li><li class="tocline"><a class="tocxref" href="#revision-history"><bdi class="secno">4. </bdi>Revision History</a></li><li class="tocline"><a class="tocxref" href="#definitions"><bdi class="secno">5. </bdi><span>Definitions</span></a><ol class="toc"><li class="tocline"><a class="tocxref" href="#path-templating"><bdi class="secno">5.1 </bdi><span>Path Templating</span></a></li><li class="tocline"><a class="tocxref" href="#mime-types"><bdi class="secno">5.2 </bdi><span>Mime Types</span></a></li><li class="tocline"><a class="tocxref" href="#http-status-codes"><bdi class="secno">5.3 </bdi><span>HTTP Status Codes</span></a></li></ol></li><li class="tocline"><a class="tocxref" href="#specification"><bdi class="secno">6. </bdi>Specification</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#format"><bdi class="secno">6.1 </bdi>Format</a></li><li class="tocline"><a class="tocxref" href="#file-structure"><bdi class="secno">6.2 </bdi>File Structure</a></li><li class="tocline"><a class="tocxref" href="#data-types"><bdi class="secno">6.3 </bdi>Data Types</a></li><li class="tocline"><a class="tocxref" href="#schema"><bdi class="secno">6.4 </bdi>Schema</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#swagger-object"><bdi class="secno">6.4.1 </bdi>Swagger Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields"><bdi class="secno">6.4.1.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects"><bdi class="secno">6.4.1.2 </bdi>Patterned Objects</a></li></ol></li><li class="tocline"><a class="tocxref" href="#info-object"><bdi class="secno">6.4.2 </bdi>Info Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-0"><bdi class="secno">6.4.2.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-0"><bdi class="secno">6.4.2.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#info-object-example"><bdi class="secno">6.4.2.3 </bdi>Info Object Example:</a></li></ol></li><li class="tocline"><a class="tocxref" href="#contact-object"><bdi class="secno">6.4.3 </bdi>Contact Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-1"><bdi class="secno">6.4.3.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-1"><bdi class="secno">6.4.3.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#contact-object-example"><bdi class="secno">6.4.3.3 </bdi>Contact Object Example:</a></li></ol></li><li class="tocline"><a class="tocxref" href="#license-object"><bdi class="secno">6.4.4 </bdi>License Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-2"><bdi class="secno">6.4.4.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-2"><bdi class="secno">6.4.4.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#license-object-example"><bdi class="secno">6.4.4.3 </bdi>License Object Example:</a></li></ol></li><li class="tocline"><a class="tocxref" href="#paths-object"><bdi class="secno">6.4.5 </bdi>Paths Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields"><bdi class="secno">6.4.5.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#paths-object-example"><bdi class="secno">6.4.5.2 </bdi>Paths Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#path-item-object"><bdi class="secno">6.4.6 </bdi>Path Item Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-3"><bdi class="secno">6.4.6.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-fields-0"><bdi class="secno">6.4.6.2 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#path-item-object-example"><bdi class="secno">6.4.6.3 </bdi>Path Item Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#operation-object"><bdi class="secno">6.4.7 </bdi>Operation Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-4"><bdi class="secno">6.4.7.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-3"><bdi class="secno">6.4.7.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#operation-object-example"><bdi class="secno">6.4.7.3 </bdi>Operation Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#external-documentation-object"><bdi class="secno">6.4.8 </bdi>External Documentation Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-5"><bdi class="secno">6.4.8.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-4"><bdi class="secno">6.4.8.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#external-documentation-object-example"><bdi class="secno">6.4.8.3 </bdi>External Documentation Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#parameter-object"><bdi class="secno">6.4.9 </bdi>Parameter Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-6"><bdi class="secno">6.4.9.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-fields-1"><bdi class="secno">6.4.9.2 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#parameter-object-examples"><bdi class="secno">6.4.9.3 </bdi>Parameter Object Examples</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#body-parameters"><bdi class="secno">6.4.9.3.1 </bdi>Body Parameters</a></li><li class="tocline"><a class="tocxref" href="#other-parameters"><bdi class="secno">6.4.9.3.2 </bdi>Other Parameters</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#items-object"><bdi class="secno">6.4.10 </bdi>Items Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-7"><bdi class="secno">6.4.10.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-5"><bdi class="secno">6.4.10.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#items-object-examples"><bdi class="secno">6.4.10.3 </bdi>Items Object Examples</a></li></ol></li><li class="tocline"><a class="tocxref" href="#responses-object"><bdi class="secno">6.4.11 </bdi>Responses Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-8"><bdi class="secno">6.4.11.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-fields-2"><bdi class="secno">6.4.11.2 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#responses-object-example"><bdi class="secno">6.4.11.3 </bdi>Responses Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#response-object"><bdi class="secno">6.4.12 </bdi>Response Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-9"><bdi class="secno">6.4.12.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-6"><bdi class="secno">6.4.12.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#response-object-examples"><bdi class="secno">6.4.12.3 </bdi>Response Object Examples</a></li></ol></li><li class="tocline"><a class="tocxref" href="#headers-object"><bdi class="secno">6.4.13 </bdi>Headers Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-3"><bdi class="secno">6.4.13.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#headers-object-example"><bdi class="secno">6.4.13.2 </bdi>Headers Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#example-object"><bdi class="secno">6.4.14 </bdi>Example Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-4"><bdi class="secno">6.4.14.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#example-object-example"><bdi class="secno">6.4.14.2 </bdi>Example Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#header-object"><bdi class="secno">6.4.15 </bdi>Header Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-objects-7"><bdi class="secno">6.4.15.1 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#header-object-example"><bdi class="secno">6.4.15.2 </bdi>Header Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#tag-object"><bdi class="secno">6.4.16 </bdi>Tag Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-10"><bdi class="secno">6.4.16.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-fields-5"><bdi class="secno">6.4.16.2 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#tag-object-example"><bdi class="secno">6.4.16.3 </bdi>Tag Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#reference-object"><bdi class="secno">6.4.17 </bdi>Reference Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-11"><bdi class="secno">6.4.17.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#reference-object-example"><bdi class="secno">6.4.17.2 </bdi>Reference Object Example</a></li><li class="tocline"><a class="tocxref" href="#relative-schema-file-example"><bdi class="secno">6.4.17.3 </bdi>Relative Schema File Example</a></li><li class="tocline"><a class="tocxref" href="#relative-files-with-embedded-schema-example"><bdi class="secno">6.4.17.4 </bdi>Relative Files With Embedded Schema Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#schema-object"><bdi class="secno">6.4.18 </bdi>Schema Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-12"><bdi class="secno">6.4.18.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-8"><bdi class="secno">6.4.18.2 </bdi>Patterned Objects</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#composition-and-inheritance-polymorphism"><bdi class="secno">6.4.18.2.1 </bdi>Composition and Inheritance (Polymorphism)</a></li><li class="tocline"><a class="tocxref" href="#xml-modeling"><bdi class="secno">6.4.18.2.2 </bdi>XML Modeling</a></li></ol></li><li class="tocline"><a class="tocxref" href="#schema-object-examples"><bdi class="secno">6.4.18.3 </bdi>Schema Object Examples</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#primitive-sample"><bdi class="secno">6.4.18.3.1 </bdi>Primitive Sample</a></li><li class="tocline"><a class="tocxref" href="#simple-model"><bdi class="secno">6.4.18.3.2 </bdi>Simple Model</a></li><li class="tocline"><a class="tocxref" href="#model-with-map-dictionary-properties"><bdi class="secno">6.4.18.3.3 </bdi>Model with Map/Dictionary Properties</a></li><li class="tocline"><a class="tocxref" href="#model-with-example"><bdi class="secno">6.4.18.3.4 </bdi>Model with Example</a></li><li class="tocline"><a class="tocxref" href="#models-with-composition"><bdi class="secno">6.4.18.3.5 </bdi>Models with Composition</a></li><li class="tocline"><a class="tocxref" href="#models-with-polymorphism-support"><bdi class="secno">6.4.18.3.6 </bdi>Models with Polymorphism Support</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#xml-object"><bdi class="secno">6.4.19 </bdi>XML Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-13"><bdi class="secno">6.4.19.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-9"><bdi class="secno">6.4.19.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#xml-object-examples"><bdi class="secno">6.4.19.3 </bdi>XML Object Examples</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#no-xml-element"><bdi class="secno">6.4.19.3.1 </bdi>No XML Element</a></li><li class="tocline"><a class="tocxref" href="#xml-name-replacement"><bdi class="secno">6.4.19.3.2 </bdi>XML Name Replacement</a></li><li class="tocline"><a class="tocxref" href="#xml-attribute-prefix-and-namespace"><bdi class="secno">6.4.19.3.3 </bdi>XML Attribute, Prefix and Namespace</a></li><li class="tocline"><a class="tocxref" href="#xml-arrays"><bdi class="secno">6.4.19.3.4 </bdi>XML Arrays</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#definitions-object"><bdi class="secno">6.4.20 </bdi>Definitions Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-6"><bdi class="secno">6.4.20.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#definitions-object-example"><bdi class="secno">6.4.20.2 </bdi>Definitions Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#parameters-definitions-object"><bdi class="secno">6.4.21 </bdi>Parameters Definitions Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-7"><bdi class="secno">6.4.21.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#parameters-definition-object-example"><bdi class="secno">6.4.21.2 </bdi>Parameters Definition Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#responses-definitions-object"><bdi class="secno">6.4.22 </bdi>Responses Definitions Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-8"><bdi class="secno">6.4.22.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#responses-definitions-object-example"><bdi class="secno">6.4.22.2 </bdi>Responses Definitions Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#security-definitions-object"><bdi class="secno">6.4.23 </bdi>Security Definitions Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-9"><bdi class="secno">6.4.23.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#security-definitions-object-example"><bdi class="secno">6.4.23.2 </bdi>Security Definitions Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#security-scheme-object"><bdi class="secno">6.4.24 </bdi>Security Scheme Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#fixed-fields-14"><bdi class="secno">6.4.24.1 </bdi>Fixed Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-fields-10"><bdi class="secno">6.4.24.2 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#security-scheme-object-example"><bdi class="secno">6.4.24.3 </bdi>Security Scheme Object Example</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#basic-authentication-sample"><bdi class="secno">6.4.24.3.1 </bdi>Basic Authentication Sample</a></li><li class="tocline"><a class="tocxref" href="#api-key-sample"><bdi class="secno">6.4.24.3.2 </bdi>API Key Sample</a></li><li class="tocline"><a class="tocxref" href="#implicit-oauth2-sample"><bdi class="secno">6.4.24.3.3 </bdi>Implicit OAuth2 Sample</a></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#scopes-object"><bdi class="secno">6.4.25 </bdi>Scopes Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-11"><bdi class="secno">6.4.25.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#patterned-objects-10"><bdi class="secno">6.4.25.2 </bdi>Patterned Objects</a></li><li class="tocline"><a class="tocxref" href="#scopes-object-example"><bdi class="secno">6.4.25.3 </bdi>Scopes Object Example</a></li></ol></li><li class="tocline"><a class="tocxref" href="#security-requirement-object"><bdi class="secno">6.4.26 </bdi>Security Requirement Object</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#patterned-fields-12"><bdi class="secno">6.4.26.1 </bdi>Patterned Fields</a></li><li class="tocline"><a class="tocxref" href="#security-requirement-object-examples"><bdi class="secno">6.4.26.2 </bdi>Security Requirement Object Examples</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#non-oauth2-security-requirement"><bdi class="secno">6.4.26.2.1 </bdi>Non-OAuth2 Security Requirement</a></li><li class="tocline"><a class="tocxref" href="#oauth2-security-requirement"><bdi class="secno">6.4.26.2.2 </bdi>OAuth2 Security Requirement</a></li></ol></li></ol></li></ol></li><li class="tocline"><a class="tocxref" href="#specification-extensions"><bdi class="secno">6.5 </bdi>Specification Extensions</a></li><li class="tocline"><a class="tocxref" href="#security-filtering"><bdi class="secno">6.6 </bdi>Security Filtering</a></li></ol></li><li class="tocline"><a class="tocxref" href="#references"><bdi class="secno">A. </bdi>References</a><ol class="toc"><li class="tocline"><a class="tocxref" href="#normative-references"><bdi class="secno">A.1 </bdi>Normative references</a></li></ol></li></ol></nav>
<section id="openapi-specification"><div class="header-wrapper"><h2 id="x1-openapi-specification"><bdi class="secno">1. </bdi>OpenAPI Specification</h2><a class="self-link" href="#openapi-specification" aria-label="Permalink for Section 1."></a></div>
</section><section id="fka-swagger-restful-api-documentation-specification"><div class="header-wrapper"><h2 id="x2-fka-swagger-restful-api-documentation-specification"><bdi class="secno">2. </bdi>(fka Swagger RESTful API Documentation Specification)</h2><a class="self-link" href="#fka-swagger-restful-api-documentation-specification" aria-label="Permalink for Section 2."></a></div>
<section class="override" id="conformance"><div class="header-wrapper"><h3 id="x2-1-version-2-0"><bdi class="secno">2.1 </bdi>Version 2.0</h3><a class="self-link" href="#conformance" aria-label="Permalink for Section 2.1"></a></div>
<p>The key words “<em class="rfc2119">MUST</em>”, “<em class="rfc2119">MUST NOT</em>”, “<em class="rfc2119">REQUIRED</em>”, “<em class="rfc2119">SHALL</em>”, “<em class="rfc2119">SHALL NOT</em>”, “<em class="rfc2119">SHOULD</em>”, “<em class="rfc2119">SHOULD NOT</em>”, “<em class="rfc2119">RECOMMENDED</em>”, “<em class="rfc2119">MAY</em>”, and “<em class="rfc2119">OPTIONAL</em>” in this document are to be interpreted as described in [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc2119" title="Key words for use in RFCs to Indicate Requirement Levels">RFC2119</a></cite>].</p>
<p>The Swagger specification is licensed under <a href="https://www.apache.org/licenses/LICENSE-2.0.html">The Apache License, Version 2.0</a>.</p>
</section></section><section id="introductions"><div class="header-wrapper"><h2 id="x3-introductions"><bdi class="secno">3. </bdi>Introductions</h2><a class="self-link" href="#introductions" aria-label="Permalink for Section 3."></a></div>
<p>Swagger™ is a project used to describe and document RESTful APIs.</p>
<p>The Swagger specification defines a set of files required to describe such an API. These files can then be used by the Swagger-UI project to display the API and Swagger-Codegen to generate clients in various languages. Additional utilities can also take advantage of the resulting files, such as testing tools.</p>
</section><section id="revision-history"><div class="header-wrapper"><h2 id="x4-revision-history"><bdi class="secno">4. </bdi>Revision History</h2><a class="self-link" href="#revision-history" aria-label="Permalink for Section 4."></a></div>
<table>
<thead>
<tr>
<th>Version</th>
<th>Date</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>2.0</td>
<td>2014-09-08</td>
<td>Release of Swagger 2.0</td>
</tr>
<tr>
<td>1.2</td>
<td>2014-03-14</td>
<td>Initial release of the formal document.</td>
</tr>
<tr>
<td>1.1</td>
<td>2012-08-22</td>
<td>Release of Swagger 1.1</td>
</tr>
<tr>
<td>1.0</td>
<td>2011-08-10</td>
<td>First release of the Swagger Specification</td>
</tr>
</tbody>
</table>
</section><section id="definitions"><div class="header-wrapper"><h2 id="x5-definitions"><bdi class="secno">5. </bdi><dfn id="dfn-definitions" tabindex="0" aria-haspopup="dialog" data-dfn-type="dfn">Definitions</dfn></h2><a class="self-link" href="#definitions" aria-label="Permalink for Section 5."></a></div>
<section id="path-templating"><div class="header-wrapper"><h3 id="x5-1-path-templating"><bdi class="secno">5.1 </bdi><dfn id="dfn-path-templating" tabindex="0" aria-haspopup="dialog" data-dfn-type="dfn">Path Templating</dfn></h3><a class="self-link" href="#path-templating" aria-label="Permalink for Section 5.1"></a></div>
<p>Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.</p>
</section><section id="mime-types"><div class="header-wrapper"><h3 id="x5-2-mime-types"><bdi class="secno">5.2 </bdi><dfn id="dfn-mime-types" tabindex="0" aria-haspopup="dialog" data-dfn-type="dfn">Mime Types</dfn></h3><a class="self-link" href="#mime-types" aria-label="Permalink for Section 5.2"></a></div>
<p>Mime type definitions are spread across several resources. The mime type definitions should be in compliance with [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc6838" title="Media Type Specifications and Registration Procedures">RFC6838</a></cite>].</p>
<p>Some examples of possible mime type definitions:</p>
<pre class="nohighlight" tabindex="0"><code> text/plain; charset=utf-8
application/json
application/vnd.github+json
application/vnd.github.v3+json
application/vnd.github.v3.raw+json
application/vnd.github.v3.text+json
application/vnd.github.v3.html+json
application/vnd.github.v3.full+json
application/vnd.github.v3.diff
application/vnd.github.v3.patch
</code></pre>
</section><section id="http-status-codes"><div class="header-wrapper"><h3 id="x5-3-http-status-codes"><bdi class="secno">5.3 </bdi><dfn id="dfn-http-status-codes" tabindex="0" aria-haspopup="dialog" data-dfn-type="dfn">HTTP Status Codes</dfn></h3><a class="self-link" href="#http-status-codes" aria-label="Permalink for Section 5.3"></a></div>
<p>The HTTP Status Codes are used to indicate the status of the executed operation. The available status codes are described by [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc7231" title="Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content">RFC7231</a></cite>] <a href="https://datatracker.ietf.org/doc/html/rfc7231#section-6">Section 6</a> and in the <cite><a class="bibref" data-link-type="biblio" href="#bib-iana-http-status-codes" title="Hypertext Transfer Protocol (HTTP) Status Code Registry">IANA Status Code Registry</a></cite>.</p>
</section></section><section id="specification"><div class="header-wrapper"><h2 id="x6-specification"><bdi class="secno">6. </bdi>Specification</h2><a class="self-link" href="#specification" aria-label="Permalink for Section 6."></a></div>
<section id="format"><div class="header-wrapper"><h3 id="x6-1-format"><bdi class="secno">6.1 </bdi>Format</h3><a class="self-link" href="#format" aria-label="Permalink for Section 6.1"></a></div>
<p>The files describing the RESTful API in accordance with the Swagger specification are represented as JSON objects and conform to the <cite><a class="bibref" data-link-type="biblio" href="#bib-rfc7159" title="The JavaScript Object Notation (JSON) Data Interchange Format">JSON</a></cite> standards. <cite><a class="bibref" data-link-type="biblio" href="#bib-yaml" title="YAML Ain’t Markup Language (YAML™) Version 1.2">YAML</a></cite>, being a superset of JSON, can be used as well to
represent a Swagger specification file.</p>
<p>For example, if a field is said to have an array value, the JSON array representation will be used:</p>
<pre class="nohighlight" tabindex="0"><code>{
<span class="hljs-string">"field"</span> : [...]
}
</code></pre>
<p>While the API is described using JSON it does not impose a JSON input/output to the API itself.</p>
<p>All field names in the specification are <strong>case sensitive</strong>.</p>
<p>The schema exposes two types of fields. Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name. Patterned fields can have multiple occurrences as long as each has a unique name.</p>
</section><section id="file-structure"><div class="header-wrapper"><h3 id="x6-2-file-structure"><bdi class="secno">6.2 </bdi>File Structure</h3><a class="self-link" href="#file-structure" aria-label="Permalink for Section 6.2"></a></div>
<p>The Swagger representation of the API is made of a single file. However, parts of the definitions can be split into separate files, at the discretion of the user. This is applicable for <code>$ref</code> fields in the specification as follows from the <a href="https://json-schema.org">JSON Schema</a> definitions.</p>
<p>By convention, the Swagger specification file is named <code>swagger.json</code>.</p>
</section><section id="data-types"><div class="header-wrapper"><h3 id="x6-3-data-types"><bdi class="secno">6.3 </bdi>Data Types</h3><a class="self-link" href="#data-types" aria-label="Permalink for Section 6.3"></a></div>
<p>Primitive data types in the Swagger Specification are based on the types supported by the <a href="https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5">JSON-Schema Draft 4</a>. Models are described using the <a href="#schema-object">Schema Object</a> which is a subset of JSON Schema Draft 4.</p>
<p>An additional primitive data type <code>"file"</code> is used by the <a href="#parameter-object">Parameter Object</a> and the <a href="#response-object">Response Object</a> to set the parameter type or the response as being a file.</p>
<p><span id="dataTypeFormat"></span>Primitives have an optional modifier property <code>format</code>. Swagger uses several known formats to more finely define the data type being used. However, the <code>format</code> property is an open <code>string</code>-valued property, and can have any value to support documentation needs. Formats such as <code>"email"</code>, <code>"uuid"</code>, etc., can be used even though they are not defined by this specification. Types that are not accompanied by a <code>format</code> property follow their definition from the JSON Schema (except for <code>file</code> type which is defined above). The formats defined by the Swagger Specification are:</p>
<table>
<thead>
<tr>
<th>Common Name</th>
<th><a href="#dataTypeType"><code>type</code></a></th>
<th><a href="#dataTypeFormat"><code>format</code></a></th>
<th>Comments</th>
</tr>
</thead>
<tbody>
<tr>
<td>integer</td>
<td><code>integer</code></td>
<td><code>int32</code></td>
<td>signed 32 bits</td>
</tr>
<tr>
<td>long</td>
<td><code>integer</code></td>
<td><code>int64</code></td>
<td>signed 64 bits</td>
</tr>
<tr>
<td>float</td>
<td><code>number</code></td>
<td><code>float</code></td>
<td></td>
</tr>
<tr>
<td>double</td>
<td><code>number</code></td>
<td><code>double</code></td>
<td></td>
</tr>
<tr>
<td>string</td>
<td><code>string</code></td>
<td></td>
<td></td>
</tr>
<tr>
<td>byte</td>
<td><code>string</code></td>
<td><code>byte</code></td>
<td>base64 encoded characters</td>
</tr>
<tr>
<td>binary</td>
<td><code>string</code></td>
<td><code>binary</code></td>
<td>any sequence of octets</td>
</tr>
<tr>
<td>boolean</td>
<td><code>boolean</code></td>
<td></td>
<td></td>
</tr>
<tr>
<td>date</td>
<td><code>string</code></td>
<td><code>date</code></td>
<td>As defined by <code>full-date</code> - [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc3339" title="Date and Time on the Internet: Timestamps">RFC3339</a></cite>] <a href="https://datatracker.ietf.org/doc/html/rfc3339#section-5.6">Section 5.6</a></td>
</tr>
<tr>
<td>dateTime</td>
<td><code>string</code></td>
<td><code>date-time</code></td>
<td>As defined by <code>date-time</code> - [<cite><a class="bibref" data-link-type="biblio" href="#bib-rfc3339" title="Date and Time on the Internet: Timestamps">RFC3339</a></cite>] <a href="https://datatracker.ietf.org/doc/html/rfc3339#section-5.6">Section 5.6</a></td>
</tr>
<tr>
<td>password</td>
<td><code>string</code></td>
<td><code>password</code></td>
<td>Used to hint UIs the input needs to be obscured.</td>
</tr>
</tbody>
</table>
</section><section id="schema"><div class="header-wrapper"><h3 id="x6-4-schema"><bdi class="secno">6.4 </bdi>Schema</h3><a class="self-link" href="#schema" aria-label="Permalink for Section 6.4"></a></div>
<section id="swagger-object"><div class="header-wrapper"><h4 id="x6-4-1-swagger-object"><bdi class="secno">6.4.1 </bdi>Swagger Object</h4><a class="self-link" href="#swagger-object" aria-label="Permalink for Section 6.4.1"></a></div>
<p>This is the root document object for the API specification. It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) together into one document.</p>
<section id="fixed-fields"><div class="header-wrapper"><h5 id="x6-4-1-1-fixed-fields"><bdi class="secno">6.4.1.1 </bdi>Fixed Fields</h5><a class="self-link" href="#fixed-fields" aria-label="Permalink for Section 6.4.1.1"></a></div>
<table>
<thead>
<tr>
<th>Field Name</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="swaggerSwagger"></span>swagger</td>
<td style="text-align:center"><code>string</code></td>
<td><strong>Required.</strong> Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value <em class="rfc2119">MUST</em> be <code>"2.0"</code>.</td>
</tr>
<tr>
<td><span id="swaggerInfo"></span>info</td>
<td style="text-align:center"><a href="#info-object">Info Object</a></td>
<td><strong>Required.</strong> Provides metadata about the API. The metadata can be used by the clients if needed.</td>
</tr>
<tr>
<td><span id="swaggerHost"></span>host</td>
<td style="text-align:center"><code>string</code></td>
<td>The host (name or ip) serving the API. This <em class="rfc2119">MUST</em> be the host only and does not include the scheme nor sub-paths. It <em class="rfc2119">MAY</em> include a port. If the <code>host</code> is not included, the host serving the documentation is to be used (including the port). The <code>host</code> does not support <a href="#path-templating">path templating</a>.</td>
</tr>
<tr>
<td><span id="swaggerBasePath"></span>basePath</td>
<td style="text-align:center"><code>string</code></td>
<td>The base path on which the API is served, which is relative to the <a href="#swaggerHost"><code>host</code></a>. If it is not included, the API is served directly under the <code>host</code>. The value <em class="rfc2119">MUST</em> start with a leading slash (<code>/</code>). The <code>basePath</code> does not support <a href="#path-templating">path templating</a>.</td>
</tr>
<tr>
<td><span id="swaggerSchemes"></span>schemes</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>The transfer protocol of the API. Values <em class="rfc2119">MUST</em> be from the list: <code>"http"</code>, <code>"https"</code>, <code>"ws"</code>, <code>"wss"</code>. If the <code>schemes</code> is not included, the default scheme to be used is the one used to access the Swagger definition itself.</td>
</tr>
<tr>
<td><span id="swaggerConsumes"></span>consumes</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value <em class="rfc2119">MUST</em> be as described under <a href="#mime-types">Mime Types</a>.</td>
</tr>
<tr>
<td><span id="swaggerProduces"></span>produces</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value <em class="rfc2119">MUST</em> be as described under <a href="#mime-types">Mime Types</a>.</td>
</tr>
<tr>
<td><span id="swaggerPaths"></span>paths</td>
<td style="text-align:center"><a href="#paths-object">Paths Object</a></td>
<td><strong>Required.</strong> The available paths and operations for the API.</td>
</tr>
<tr>
<td><span id="swaggerDefinitions"></span>definitions</td>
<td style="text-align:center"><a href="#definitions-object">Definitions Object</a></td>
<td>An object to hold data types produced and consumed by operations.</td>
</tr>
<tr>
<td><span id="swaggerParameters"></span>parameters</td>
<td style="text-align:center"><a href="#parameters-definitions-object">Parameters Definitions Object</a></td>
<td>An object to hold parameters that can be used across operations. This property <em>does not</em> define global parameters for all operations.</td>
</tr>
<tr>
<td><span id="swaggerResponses"></span>responses</td>
<td style="text-align:center"><a href="#responses-definitions-object">Responses Definitions Object</a></td>
<td>An object to hold responses that can be used across operations. This property <em>does not</em> define global responses for all operations.</td>
</tr>
<tr>
<td><span id="swaggerSecurityDefinitions"></span>securityDefinitions</td>
<td style="text-align:center"><a href="#security-definitions-object">Security Definitions Object</a></td>
<td>Security scheme definitions that can be used across the specification.</td>
</tr>
<tr>
<td><span id="swaggerSecurity"></span>security</td>
<td style="text-align:center">[<a href="#security-requirement-object">Security Requirement Object</a>]</td>
<td>A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.</td>
</tr>
<tr>
<td><span id="swaggerTags"></span>tags</td>
<td style="text-align:center">[<a href="#tag-object">Tag Object</a>]</td>
<td>A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the <a href="#operation-object">Operation Object</a> must be declared. The tags that are not declared may be organized randomly or based on the tools’ logic. Each tag name in the list <em class="rfc2119">MUST</em> be unique.</td>
</tr>
<tr>
<td><span id="swaggerExternalDocs"></span>externalDocs</td>
<td style="text-align:center"><a href="#external-documentation-object">External Documentation Object</a></td>
<td>Additional external documentation.</td>
</tr>
</tbody>
</table>
</section><section id="patterned-objects"><div class="header-wrapper"><h5 id="x6-4-1-2-patterned-objects"><bdi class="secno">6.4.1.2 </bdi>Patterned Objects</h5><a class="self-link" href="#patterned-objects" aria-label="Permalink for Section 6.4.1.2"></a></div>
<table>
<thead>
<tr>
<th>Field Pattern</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="swaggerExtensions"></span>^x-</td>
<td style="text-align:center">Any</td>
<td>Allows extensions to the Swagger Schema. The field name <em class="rfc2119">MUST</em> begin with <code>x-</code>, for example, <code>x-internal-id</code>. The value can be <code>null</code>, a primitive, an array or an object. See <a href="#specification-extensions">Vendor Extensions</a> for further details.</td>
</tr>
</tbody>
</table>
</section></section><section id="info-object"><div class="header-wrapper"><h4 id="x6-4-2-info-object"><bdi class="secno">6.4.2 </bdi>Info Object</h4><a class="self-link" href="#info-object" aria-label="Permalink for Section 6.4.2"></a></div>
<p>The object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience.</p>
<section id="fixed-fields-0"><div class="header-wrapper"><h5 id="x6-4-2-1-fixed-fields"><bdi class="secno">6.4.2.1 </bdi>Fixed Fields</h5><a class="self-link" href="#fixed-fields-0" aria-label="Permalink for Section 6.4.2.1"></a></div>
<table>
<thead>
<tr>
<th>Field Name</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="infoTitle"></span>title</td>
<td style="text-align:center"><code>string</code></td>
<td><strong>Required.</strong> The title of the application.</td>
</tr>
<tr>
<td><span id="infoDescription"></span>description</td>
<td style="text-align:center"><code>string</code></td>
<td>A short description of the application. <a href="https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown">GFM syntax</a> can be used for rich text representation.</td>
</tr>
<tr>
<td><span id="infoTermsOfService"></span>termsOfService</td>
<td style="text-align:center"><code>string</code></td>
<td>The Terms of Service for the API.</td>
</tr>
<tr>
<td><span id="infoContact"></span>contact</td>
<td style="text-align:center"><a href="#contact-object">Contact Object</a></td>
<td>The contact information for the exposed API.</td>
</tr>
<tr>
<td><span id="infoLicense"></span>license</td>
<td style="text-align:center"><a href="#license-object">License Object</a></td>
<td>The license information for the exposed API.</td>
</tr>
<tr>
<td><span id="infoVersion"></span>version</td>
<td style="text-align:center"><code>string</code></td>
<td><strong>Required</strong> Provides the version of the application API (not to be confused with the specification version).</td>
</tr>
</tbody>
</table>
</section><section id="patterned-objects-0"><div class="header-wrapper"><h5 id="x6-4-2-2-patterned-objects"><bdi class="secno">6.4.2.2 </bdi>Patterned Objects</h5><a class="self-link" href="#patterned-objects-0" aria-label="Permalink for Section 6.4.2.2"></a></div>
<table>
<thead>
<tr>
<th>Field Pattern</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="infoExtensions"></span>^x-</td>
<td style="text-align:center">Any</td>
<td>Allows extensions to the Swagger Schema. The field name <em class="rfc2119">MUST</em> begin with <code>x-</code>, for example, <code>x-internal-id</code>. The value can be <code>null</code>, a primitive, an array or an object. See <a href="#specification-extensions">Vendor Extensions</a> for further details.</td>
</tr>
</tbody>
</table>
</section><section id="info-object-example"><div class="header-wrapper"><h5 id="x6-4-2-3-info-object-example"><bdi class="secno">6.4.2.3 </bdi>Info Object Example:</h5><a class="self-link" href="#info-object-example" aria-label="Permalink for Section 6.4.2.3"></a></div>
<pre class="nohighlight" tabindex="0"><code>{
<span class="hljs-string">"title"</span>: <span class="hljs-string">"Swagger Sample App"</span>,
<span class="hljs-string">"description"</span>: <span class="hljs-string">"This is a sample server Petstore server."</span>,
<span class="hljs-string">"termsOfService"</span>: <span class="hljs-string">"http://swagger.io/terms/"</span>,
<span class="hljs-string">"contact"</span>: {
<span class="hljs-string">"name"</span>: <span class="hljs-string">"API Support"</span>,
<span class="hljs-string">"url"</span>: <span class="hljs-string">"http://www.swagger.io/support"</span>,
<span class="hljs-string">"email"</span>: <span class="hljs-string">"[email protected]"</span>
},
<span class="hljs-string">"license"</span>: {
<span class="hljs-string">"name"</span>: <span class="hljs-string">"Apache 2.0"</span>,
<span class="hljs-string">"url"</span>: <span class="hljs-string">"http://www.apache.org/licenses/LICENSE-2.0.html"</span>
},
<span class="hljs-string">"version"</span>: <span class="hljs-string">"1.0.1"</span>
}
</code></pre>
<pre class="nohighlight" tabindex="0"><code><span class="hljs-attr">title:</span> <span class="hljs-string">Swagger</span> <span class="hljs-string">Sample</span> <span class="hljs-string">App</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">This</span> <span class="hljs-string">is</span> <span class="hljs-string">a</span> <span class="hljs-string">sample</span> <span class="hljs-string">server</span> <span class="hljs-string">Petstore</span> <span class="hljs-string">server.</span>
<span class="hljs-attr">termsOfService:</span> <span class="hljs-string">http://swagger.io/terms/</span>
<span class="hljs-attr">contact:</span>
<span class="hljs-attr">name:</span> <span class="hljs-string">API</span> <span class="hljs-string">Support</span>
<span class="hljs-attr">url:</span> <span class="hljs-string">http://www.swagger.io/support</span>
<span class="hljs-attr">email:</span> <span class="hljs-string">[email protected]</span>
<span class="hljs-attr">license:</span>
<span class="hljs-attr">name:</span> <span class="hljs-string">Apache</span> <span class="hljs-number">2.0</span>
<span class="hljs-attr">url:</span> <span class="hljs-string">http://www.apache.org/licenses/LICENSE-2.0.html</span>
<span class="hljs-attr">version:</span> <span class="hljs-number">1.0</span><span class="hljs-number">.1</span>
</code></pre>
</section></section><section id="contact-object"><div class="header-wrapper"><h4 id="x6-4-3-contact-object"><bdi class="secno">6.4.3 </bdi>Contact Object</h4><a class="self-link" href="#contact-object" aria-label="Permalink for Section 6.4.3"></a></div>
<p>Contact information for the exposed API.</p>
<section id="fixed-fields-1"><div class="header-wrapper"><h5 id="x6-4-3-1-fixed-fields"><bdi class="secno">6.4.3.1 </bdi>Fixed Fields</h5><a class="self-link" href="#fixed-fields-1" aria-label="Permalink for Section 6.4.3.1"></a></div>
<table>
<thead>
<tr>
<th>Field Name</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="contactName"></span>name</td>
<td style="text-align:center"><code>string</code></td>
<td>The identifying name of the contact person/organization.</td>
</tr>
<tr>
<td><span id="contactUrl"></span>url</td>
<td style="text-align:center"><code>string</code></td>
<td>The URL pointing to the contact information. <em class="rfc2119">MUST</em> be in the format of a URL.</td>
</tr>
<tr>
<td><span id="contactEmail"></span>email</td>
<td style="text-align:center"><code>string</code></td>
<td>The email address of the contact person/organization. <em class="rfc2119">MUST</em> be in the format of an email address.</td>
</tr>
</tbody>
</table>
</section><section id="patterned-objects-1"><div class="header-wrapper"><h5 id="x6-4-3-2-patterned-objects"><bdi class="secno">6.4.3.2 </bdi>Patterned Objects</h5><a class="self-link" href="#patterned-objects-1" aria-label="Permalink for Section 6.4.3.2"></a></div>
<table>
<thead>
<tr>
<th>Field Pattern</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="contactExtensions"></span>^x-</td>
<td style="text-align:center">Any</td>
<td>Allows extensions to the Swagger Schema. The field name <em class="rfc2119">MUST</em> begin with <code>x-</code>, for example, <code>x-internal-id</code>. The value can be <code>null</code>, a primitive, an array or an object. See <a href="#specification-extensions">Vendor Extensions</a> for further details.</td>
</tr>
</tbody>
</table>
</section><section id="contact-object-example"><div class="header-wrapper"><h5 id="x6-4-3-3-contact-object-example"><bdi class="secno">6.4.3.3 </bdi>Contact Object Example:</h5><a class="self-link" href="#contact-object-example" aria-label="Permalink for Section 6.4.3.3"></a></div>
<pre class="nohighlight" tabindex="0"><code>{
<span class="hljs-string">"name"</span>: <span class="hljs-string">"API Support"</span>,
<span class="hljs-string">"url"</span>: <span class="hljs-string">"http://www.swagger.io/support"</span>,
<span class="hljs-string">"email"</span>: <span class="hljs-string">"[email protected]"</span>
}
</code></pre>
<pre class="nohighlight" tabindex="0"><code><span class="hljs-attr">name:</span> <span class="hljs-string">API</span> <span class="hljs-string">Support</span>
<span class="hljs-attr">url:</span> <span class="hljs-string">http://www.swagger.io/support</span>
<span class="hljs-attr">email:</span> <span class="hljs-string">[email protected]</span>
</code></pre>
</section></section><section id="license-object"><div class="header-wrapper"><h4 id="x6-4-4-license-object"><bdi class="secno">6.4.4 </bdi>License Object</h4><a class="self-link" href="#license-object" aria-label="Permalink for Section 6.4.4"></a></div>
<p>License information for the exposed API.</p>
<section id="fixed-fields-2"><div class="header-wrapper"><h5 id="x6-4-4-1-fixed-fields"><bdi class="secno">6.4.4.1 </bdi>Fixed Fields</h5><a class="self-link" href="#fixed-fields-2" aria-label="Permalink for Section 6.4.4.1"></a></div>
<table>
<thead>
<tr>
<th>Field Name</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="licenseName"></span>name</td>
<td style="text-align:center"><code>string</code></td>
<td><strong>Required.</strong> The license name used for the API.</td>
</tr>
<tr>
<td><span id="licenseUrl"></span>url</td>
<td style="text-align:center"><code>string</code></td>
<td>A URL to the license used for the API. <em class="rfc2119">MUST</em> be in the format of a URL.</td>
</tr>
</tbody>
</table>
</section><section id="patterned-objects-2"><div class="header-wrapper"><h5 id="x6-4-4-2-patterned-objects"><bdi class="secno">6.4.4.2 </bdi>Patterned Objects</h5><a class="self-link" href="#patterned-objects-2" aria-label="Permalink for Section 6.4.4.2"></a></div>
<table>
<thead>
<tr>
<th>Field Pattern</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="licenseExtensions"></span>^x-</td>
<td style="text-align:center">Any</td>
<td>Allows extensions to the Swagger Schema. The field name <em class="rfc2119">MUST</em> begin with <code>x-</code>, for example, <code>x-internal-id</code>. The value can be <code>null</code>, a primitive, an array or an object. See <a href="#specification-extensions">Vendor Extensions</a> for further details.</td>
</tr>
</tbody>
</table>
</section><section id="license-object-example"><div class="header-wrapper"><h5 id="x6-4-4-3-license-object-example"><bdi class="secno">6.4.4.3 </bdi>License Object Example:</h5><a class="self-link" href="#license-object-example" aria-label="Permalink for Section 6.4.4.3"></a></div>
<pre class="nohighlight" tabindex="0"><code>{
<span class="hljs-string">"name"</span>: <span class="hljs-string">"Apache 2.0"</span>,
<span class="hljs-string">"url"</span>: <span class="hljs-string">"http://www.apache.org/licenses/LICENSE-2.0.html"</span>
}
</code></pre>
<pre class="nohighlight" tabindex="0"><code><span class="hljs-attr">name:</span> <span class="hljs-string">Apache</span> <span class="hljs-number">2.0</span>
<span class="hljs-attr">url:</span> <span class="hljs-string">http://www.apache.org/licenses/LICENSE-2.0.html</span>
</code></pre>
</section></section><section id="paths-object"><div class="header-wrapper"><h4 id="x6-4-5-paths-object"><bdi class="secno">6.4.5 </bdi>Paths Object</h4><a class="self-link" href="#paths-object" aria-label="Permalink for Section 6.4.5"></a></div>
<p>Holds the relative paths to the individual endpoints. The path is appended to the <a href="#swaggerBasePath"><code>basePath</code></a> in order to construct the full URL.
The Paths may be empty, due to <a href="#security-filtering">ACL constraints</a>.</p>
<section id="patterned-fields"><div class="header-wrapper"><h5 id="x6-4-5-1-patterned-fields"><bdi class="secno">6.4.5.1 </bdi>Patterned Fields</h5><a class="self-link" href="#patterned-fields" aria-label="Permalink for Section 6.4.5.1"></a></div>
<table>
<thead>
<tr>
<th>Field Pattern</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="pathsPath"></span>/{path}</td>
<td style="text-align:center"><a href="#path-item-object">Path Item Object</a></td>
<td>A relative path to an individual endpoint. The field name <em class="rfc2119">MUST</em> begin with a slash. The path is appended to the <a href="#swaggerBasePath"><code>basePath</code></a> in order to construct the full URL. <a href="#path-templating">Path templating</a> is allowed.</td>
</tr>
<tr>
<td><span id="pathsExtensions"></span>^x-</td>
<td style="text-align:center">Any</td>
<td>Allows extensions to the Swagger Schema. The field name <em class="rfc2119">MUST</em> begin with <code>x-</code>, for example, <code>x-internal-id</code>. The value can be <code>null</code>, a primitive, an array or an object. See <a href="#specification-extensions">Vendor Extensions</a> for further details.</td>
</tr>
</tbody>
</table>
</section><section id="paths-object-example"><div class="header-wrapper"><h5 id="x6-4-5-2-paths-object-example"><bdi class="secno">6.4.5.2 </bdi>Paths Object Example</h5><a class="self-link" href="#paths-object-example" aria-label="Permalink for Section 6.4.5.2"></a></div>
<pre class="nohighlight" tabindex="0"><code>{
<span class="hljs-string">"/pets"</span>: {
<span class="hljs-string">"get"</span>: {
<span class="hljs-string">"description"</span>: <span class="hljs-string">"Returns all pets from the system that the user has access to"</span>,
<span class="hljs-string">"produces"</span>: [
<span class="hljs-string">"application/json"</span>
],
<span class="hljs-string">"responses"</span>: {
<span class="hljs-string">"200"</span>: {
<span class="hljs-string">"description"</span>: <span class="hljs-string">"A list of pets."</span>,
<span class="hljs-string">"schema"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"array"</span>,
<span class="hljs-string">"items"</span>: {
<span class="hljs-string">"$ref"</span>: <span class="hljs-string">"#/definitions/pet"</span>
}
}
}
}
}
}
}
</code></pre>
<pre class="nohighlight" tabindex="0"><code><span class="hljs-string">/pets:</span>
<span class="hljs-attr">get:</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">Returns</span> <span class="hljs-string">all</span> <span class="hljs-string">pets</span> <span class="hljs-string">from</span> <span class="hljs-string">the</span> <span class="hljs-string">system</span> <span class="hljs-string">that</span> <span class="hljs-string">the</span> <span class="hljs-string">user</span> <span class="hljs-string">has</span> <span class="hljs-string">access</span> <span class="hljs-string">to</span>
<span class="hljs-attr">produces:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">application/json</span>
<span class="hljs-attr">responses:</span>
<span class="hljs-attr">'200':</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">A</span> <span class="hljs-string">list</span> <span class="hljs-string">of</span> <span class="hljs-string">pets.</span>
<span class="hljs-attr">schema:</span>
<span class="hljs-attr">type:</span> <span class="hljs-string">array</span>
<span class="hljs-attr">items:</span>
<span class="hljs-string">$ref:</span> <span class="hljs-string">'#/definitions/pet'</span>
</code></pre>
</section></section><section id="path-item-object"><div class="header-wrapper"><h4 id="x6-4-6-path-item-object"><bdi class="secno">6.4.6 </bdi>Path Item Object</h4><a class="self-link" href="#path-item-object" aria-label="Permalink for Section 6.4.6"></a></div>
<p>Describes the operations available on a single path.
A Path Item may be empty, due to <a href="#security-filtering">ACL constraints</a>. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.</p>
<section id="fixed-fields-3"><div class="header-wrapper"><h5 id="x6-4-6-1-fixed-fields"><bdi class="secno">6.4.6.1 </bdi>Fixed Fields</h5><a class="self-link" href="#fixed-fields-3" aria-label="Permalink for Section 6.4.6.1"></a></div>
<table>
<thead>
<tr>
<th>Field Name</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="pathItemRef"></span>$ref</td>
<td style="text-align:center"><code>string</code></td>
<td>Allows for an external definition of this path item. The referenced structure <em class="rfc2119">MUST</em> be in the format of a <a href="#path-item-object">Path Item Object</a>. If there are conflicts between the referenced definition and this Path Item’s definition, the behavior is <em>undefined</em>.</td>
</tr>
<tr>
<td><span id="pathItemGet"></span>get</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a GET operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemPut"></span>put</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a PUT operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemPost"></span>post</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a POST operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemDelete"></span>delete</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a DELETE operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemOptions"></span>options</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a OPTIONS operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemHead"></span>head</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a HEAD operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemPatch"></span>patch</td>
<td style="text-align:center"><a href="#operation-object">Operation Object</a></td>
<td>A definition of a PATCH operation on this path.</td>
</tr>
<tr>
<td><span id="pathItemParameters"></span>parameters</td>
<td style="text-align:center">[<a href="#parameter-object">Parameter Object</a> | <a href="#reference-object">Reference Object</a>]</td>
<td>A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list <em class="rfc2119">MUST NOT</em> include duplicated parameters. A unique parameter is defined by a combination of a <a href="#parameterName">name</a> and <a href="#parameterIn">location</a>. The list can use the <a href="#reference-object">Reference Object</a> to link to parameters that are defined at the <a href="#swaggerParameters">Swagger Object’s parameters</a>. There can be one “body” parameter at most.</td>
</tr>
</tbody>
</table>
</section><section id="patterned-fields-0"><div class="header-wrapper"><h5 id="x6-4-6-2-patterned-fields"><bdi class="secno">6.4.6.2 </bdi>Patterned Fields</h5><a class="self-link" href="#patterned-fields-0" aria-label="Permalink for Section 6.4.6.2"></a></div>
<table>
<thead>
<tr>
<th>Field Pattern</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="pathItemExtensions"></span>^x-</td>
<td style="text-align:center">Any</td>
<td>Allows extensions to the Swagger Schema. The field name <em class="rfc2119">MUST</em> begin with <code>x-</code>, for example, <code>x-internal-id</code>. The value can be <code>null</code>, a primitive, an array or an object. See <a href="#specification-extensions">Vendor Extensions</a> for further details.</td>
</tr>
</tbody>
</table>
</section><section id="path-item-object-example"><div class="header-wrapper"><h5 id="x6-4-6-3-path-item-object-example"><bdi class="secno">6.4.6.3 </bdi>Path Item Object Example</h5><a class="self-link" href="#path-item-object-example" aria-label="Permalink for Section 6.4.6.3"></a></div>
<pre class="nohighlight" tabindex="0"><code>{
<span class="hljs-string">"get"</span>: {
<span class="hljs-string">"description"</span>: <span class="hljs-string">"Returns pets based on ID"</span>,
<span class="hljs-string">"summary"</span>: <span class="hljs-string">"Find pets by ID"</span>,
<span class="hljs-string">"operationId"</span>: <span class="hljs-string">"getPetsById"</span>,
<span class="hljs-string">"produces"</span>: [
<span class="hljs-string">"application/json"</span>,
<span class="hljs-string">"text/html"</span>
],
<span class="hljs-string">"responses"</span>: {
<span class="hljs-string">"200"</span>: {
<span class="hljs-string">"description"</span>: <span class="hljs-string">"pet response"</span>,
<span class="hljs-string">"schema"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"array"</span>,
<span class="hljs-string">"items"</span>: {
<span class="hljs-string">"$ref"</span>: <span class="hljs-string">"#/definitions/Pet"</span>
}
}
},
<span class="hljs-string">"default"</span>: {
<span class="hljs-string">"description"</span>: <span class="hljs-string">"error payload"</span>,
<span class="hljs-string">"schema"</span>: {
<span class="hljs-string">"$ref"</span>: <span class="hljs-string">"#/definitions/ErrorModel"</span>
}
}
}
},
<span class="hljs-string">"parameters"</span>: [
{
<span class="hljs-string">"name"</span>: <span class="hljs-string">"id"</span>,
<span class="hljs-string">"in"</span>: <span class="hljs-string">"path"</span>,
<span class="hljs-string">"description"</span>: <span class="hljs-string">"ID of pet to use"</span>,
<span class="hljs-string">"required"</span>: <span class="hljs-literal">true</span>,
<span class="hljs-string">"type"</span>: <span class="hljs-string">"array"</span>,
<span class="hljs-string">"items"</span>: {
<span class="hljs-string">"type"</span>: <span class="hljs-string">"string"</span>
},
<span class="hljs-string">"collectionFormat"</span>: <span class="hljs-string">"csv"</span>
}
]
}
</code></pre>
<pre class="nohighlight" tabindex="0"><code><span class="hljs-attr">get:</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">Returns</span> <span class="hljs-string">pets</span> <span class="hljs-string">based</span> <span class="hljs-string">on</span> <span class="hljs-string">ID</span>
<span class="hljs-attr">summary:</span> <span class="hljs-string">Find</span> <span class="hljs-string">pets</span> <span class="hljs-string">by</span> <span class="hljs-string">ID</span>
<span class="hljs-attr">operationId:</span> <span class="hljs-string">getPetsById</span>
<span class="hljs-attr">produces:</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">application/json</span>
<span class="hljs-bullet">-</span> <span class="hljs-string">text/html</span>
<span class="hljs-attr">responses:</span>
<span class="hljs-attr">'200':</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">pet</span> <span class="hljs-string">response</span>
<span class="hljs-attr">schema:</span>
<span class="hljs-attr">type:</span> <span class="hljs-string">array</span>
<span class="hljs-attr">items:</span>
<span class="hljs-string">$ref:</span> <span class="hljs-string">'#/definitions/Pet'</span>
<span class="hljs-attr">default:</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">error</span> <span class="hljs-string">payload</span>
<span class="hljs-attr">schema:</span>
<span class="hljs-string">$ref:</span> <span class="hljs-string">'#/definitions/ErrorModel'</span>
<span class="hljs-attr">parameters:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">id</span>
<span class="hljs-attr">in:</span> <span class="hljs-string">path</span>
<span class="hljs-attr">description:</span> <span class="hljs-string">ID</span> <span class="hljs-string">of</span> <span class="hljs-string">pet</span> <span class="hljs-string">to</span> <span class="hljs-string">use</span>
<span class="hljs-attr">required:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">type:</span> <span class="hljs-string">array</span>
<span class="hljs-attr">items:</span>
<span class="hljs-attr">type:</span> <span class="hljs-string">string</span>
<span class="hljs-attr">collectionFormat:</span> <span class="hljs-string">csv</span>
</code></pre>
</section></section><section id="operation-object"><div class="header-wrapper"><h4 id="x6-4-7-operation-object"><bdi class="secno">6.4.7 </bdi>Operation Object</h4><a class="self-link" href="#operation-object" aria-label="Permalink for Section 6.4.7"></a></div>
<p>Describes a single API operation on a path.</p>
<section id="fixed-fields-4"><div class="header-wrapper"><h5 id="x6-4-7-1-fixed-fields"><bdi class="secno">6.4.7.1 </bdi>Fixed Fields</h5><a class="self-link" href="#fixed-fields-4" aria-label="Permalink for Section 6.4.7.1"></a></div>
<table>
<thead>
<tr>
<th>Field Name</th>
<th style="text-align:center">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="operationTags"></span>tags</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.</td>
</tr>
<tr>
<td><span id="operationSummary"></span>summary</td>
<td style="text-align:center"><code>string</code></td>
<td>A short summary of what the operation does. For maximum readability in the swagger-ui, this field <em class="rfc2119">SHOULD</em> be less than 120 characters.</td>
</tr>
<tr>
<td><span id="operationDescription"></span>description</td>
<td style="text-align:center"><code>string</code></td>
<td>A verbose explanation of the operation behavior. <a href="https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown">GFM syntax</a> can be used for rich text representation.</td>
</tr>
<tr>
<td><span id="operationExternalDocs"></span>externalDocs</td>
<td style="text-align:center"><a href="#external-documentation-object">External Documentation Object</a></td>
<td>Additional external documentation for this operation.</td>
</tr>
<tr>
<td><span id="operationId"></span>operationId</td>
<td style="text-align:center"><code>string</code></td>
<td>Unique string used to identify the operation. The id <em class="rfc2119">MUST</em> be unique among all operations described in the API. Tools and libraries <em class="rfc2119">MAY</em> use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.</td>
</tr>
<tr>
<td><span id="operationConsumes"></span>consumes</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>A list of MIME types the operation can consume. This overrides the <a href="#swaggerConsumes"><code>consumes</code></a> definition at the Swagger Object. An empty value <em class="rfc2119">MAY</em> be used to clear the global definition. Value <em class="rfc2119">MUST</em> be as described under <a href="#mime-types">Mime Types</a>.</td>
</tr>
<tr>
<td><span id="operationProduces"></span>produces</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>A list of MIME types the operation can produce. This overrides the <a href="#swaggerProduces"><code>produces</code></a> definition at the Swagger Object. An empty value <em class="rfc2119">MAY</em> be used to clear the global definition. Value <em class="rfc2119">MUST</em> be as described under <a href="#mime-types">Mime Types</a>.</td>
</tr>
<tr>
<td><span id="operationParameters"></span>parameters</td>
<td style="text-align:center">[<a href="#parameter-object">Parameter Object</a> | <a href="#reference-object">Reference Object</a>]</td>
<td>A list of parameters that are applicable for this operation. If a parameter is already defined at the <a href="#pathItemParameters">Path Item</a>, the new definition will override it, but can never remove it. The list <em class="rfc2119">MUST NOT</em> include duplicated parameters. A unique parameter is defined by a combination of a <a href="#parameterName">name</a> and <a href="#parameterIn">location</a>. The list can use the <a href="#reference-object">Reference Object</a> to link to parameters that are defined at the <a href="#swaggerParameters">Swagger Object’s parameters</a>. There can be one “body” parameter at most.</td>
</tr>
<tr>
<td><span id="operationResponses"></span>responses</td>
<td style="text-align:center"><a href="#responses-object">Responses Object</a></td>
<td><strong>Required.</strong> The list of possible responses as they are returned from executing this operation.</td>
</tr>
<tr>
<td><span id="operationSchemes"></span>schemes</td>
<td style="text-align:center">[<code>string</code>]</td>
<td>The transfer protocol for the operation. Values <em class="rfc2119">MUST</em> be from the list: <code>"http"</code>, <code>"https"</code>, <code>"ws"</code>, <code>"wss"</code>. The value overrides the Swagger Object <a href="#swaggerSchemes"><code>schemes</code></a> definition.</td>
</tr>
<tr>
<td><span id="operationDeprecated"></span>deprecated</td>
<td style="text-align:center"><code>boolean</code></td>