/
interfaces.ts
2137 lines (2093 loc) · 71.8 KB
/
interfaces.ts
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
/**
* This is the root document object of the OpenAPI document.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IOpenAPI
*/
export interface IOpenAPI {
/**
* This string MUST be the semantic version number of the OpenAPI Specification version
* that the OpenAPI document uses. The openapi field SHOULD be used by tooling
* specifications and clients to interpret the OpenAPI document. This is not related
* to the API info.version string.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IOpenAPI
*/
openapi: string;
/**
* Provides metadata about the API. The metadata MAY be used by tooling as required.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiInfo}
* @memberof IOpenAPI
*/
info: IApiInfo;
/**
* An array of Server Objects, which provide connectivity information to a target
* server. If the servers property is not provided, or is an empty array, the default
* value would be a Server Object with a url value of /.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiServer[]}
* @memberof IOpenAPI
*/
servers?: IApiServer[];
/**
* The available paths and operations for the API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiPaths}
* @memberof IOpenAPI
*/
paths: IApiPaths;
/**
* An element to hold various schemas for the specification.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiComponent[]}
* @memberof IOpenAPI
*/
components?: IApiComponents;
/**
* A declaration of which security mechanisms can be used across the API. The list
* of values includes alternative security requirement objects that can be used.
* Only one of the security requirement objects need to be satisfied to authorize
* a request. Individual operations can override this definition.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiSecurityRequirement[]}
* @memberof IOpenAPI
*/
security?: IApiSecurityRequirement[];
/**
* 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 Operation Object 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 MUST be unique.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiTag[]}
* @memberof IOpenAPI
*/
tags?: IApiTag[];
/**
* Additional external documentation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiExternalDocumentation}
* @memberof IOpenAPI
*/
externalDocs?: IApiExternalDocumentation;
}
/**
* The object provides metadata about the API. The metadata MAY be used by the clients
* if needed, and MAY be presented in editing or documentation generation tools for
* convenience.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiInfo
*/
export interface IApiInfo {
/**
* The title of the application.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiInfo
*/
title: string;
/**
* A short description of the application. CommonMark syntax MAY be used for rich
* text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiInfo
*/
description?: string;
/**
* A URL to the Terms of Service for the API. MUST be in the format of a URL.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiInfo
*/
termsOfService?: string;
/**
* The contact information for the exposed API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiContact}
* @memberof IApiInfo
*/
contact?: IApiContact;
/**
* The license information for the exposed API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiLicense}
* @memberof IApiInfo
*/
license?: IApiLicense;
/**
* The version of the OpenAPI document (which is distinct from the OpenAPI
* Specification version or the API implementation version).
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiInfo
*/
version: string;
}
/**
* Contact information for the exposed API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiContact
*/
export interface IApiContact {
/**
* The identifying name of the contact person/organization.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiContact
*/
name?: string;
/**
* The URL pointing to the contact information. MUST be in the format of a URL.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiContact
*/
url?: string;
/**
* The email address of the contact person/organization. MUST be in the format
* of an email address.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiContact
*/
email?: string;
}
/**
* License information for the exposed API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiLicense
*/
export interface IApiLicense {
/**
* The license name used for the API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiLicense
*/
name: string;
/**
* A URL to the license used for the API. MUST be in the format of a URL.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiLicense
*/
url?: string;
}
/**
* An object representing a Server.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiServer
*/
export interface IApiServer {
/**
* A URL to the target host. This URL supports Server Variables and MAY be
* relative, to indicate that the host location is relative to the location
* where the OpenAPI document is being served. Variable substitutions will
* be made when a variable is named in {brackets}.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiServer
*/
url: string;
/**
* An optional string describing the host designated by the URL. CommonMark
* syntax MAY be used for rich text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiServer
*/
description?: string;
/**
* A map between a variable name and its value. The value is used for substitution
* in the server's URL template.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {{
* [key: string]: IApiServerVariable;
* }}
* @memberof IApiServer
*/
variables?: {
[key: string]: IApiServerVariable;
};
}
/**
* An object representing a Server Variable for server URL template substitution.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiServerVariable
*/
export interface IApiServerVariable {
/**
* An enumeration of string values to be used if the substitution options are
* from a limited set.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string[]}
* @memberof IApiServerVariable
*/
enum?: string[];
/**
* The default value to use for substitution, which SHALL be sent if an alternate
* value is not supplied. Note this behavior is different than the Schema Object's
* treatment of default values, because in those cases parameter values are optional.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiServerVariable
*/
default: string;
/**
* An optional description for the server variable. CommonMark syntax MAY be used for
* rich text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiServerVariable
*/
description?: string;
}
/**
* Holds a set of reusable objects for different aspects of the OAS. All objects defined
* within the components object will have no effect on the API unless they are explicitly
* referenced from properties outside the components object.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiComponents
*/
export interface IApiComponents {
/**
* An object to hold reusable Schema Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiSchema | IApiReference;
* })}
* @memberof IApiComponents
*/
schemas?: {
[key: string]: IApiSchema | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Response Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiResponse | IApiReference;
* })}
* @memberof IApiComponents
*/
responses?: {
[key: string]: IApiResponse | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Parameter Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiParameter | IApiReference;
* })}
* @memberof IApiComponents
*/
parameters?: {
[key: string]: IApiParameter | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Example Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiExample | IApiReference;
* })}
* @memberof IApiComponents
*/
examples?: {
[key: string]: IApiExample | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Request Body Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiRequestBody | IApiReference;
* })}
* @memberof IApiComponents
*/
requestBodies?: {
[key: string]: IApiRequestBody | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Header Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiHeader | IApiReference;
* })}
* @memberof IApiComponents
*/
headers?: {
[key: string]: IApiHeader | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Security Scheme Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiSecurityScheme | IApiReference;
* })}
* @memberof IApiComponents
*/
securitySchemes?: {
[key: string]: IApiSecurityScheme | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Link Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiLink | IApiReference;
* })}
* @memberof IApiComponents
*/
links?: {
[key: string]: IApiLink | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
/**
* An object to hold reusable Callback Objects.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiCallback | IApiReference;
* })}
* @memberof IApiComponents
*/
callbacks?: {
[key: string]: IApiCallback | IApiReference; // Allowed characters: "A..Z a..z 0..9 . _ -"
};
}
/**
* Holds the relative paths to the individual endpoints and their operations.
* The path is appended to the URL from the Server Object in order to construct
* the full URL. The Paths MAY be empty, due to ACL constraints.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiPaths
*/
export interface IApiPaths {
/**
* A relative path to an individual endpoint. The field name MUST begin with a slash.
* The path is appended (no relative URL resolution) to the expanded URL from the
* Server Object's url field in order to construct the full URL. Path templating
* is allowed. When matching URLs, concrete (non-templated) paths would be matched
* before their templated counterparts. Templated paths with the same hierarchy but
* different templated names MUST NOT exist as they are identical. In case of
* ambiguous matching, it's up to the tooling to decide which one to use.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiPathItem}
* @memberof IApiPaths
*/
[path: string]: IApiPathItem;
}
/**
* Describes the operations available on a single path. A Path Item MAY be empty,
* due to ACL constraints. The path itself is still exposed to the documentation viewer
* but they will not know which operations and parameters are available.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiPathItem
*/
export interface IApiPathItem {
/**
* Allows for an external definition of this path item. The referenced structure MUST
* be in the format of a Path Item Object. If there are conflicts between the referenced
* definition and this Path Item's definition, the behavior is *undefined*.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiPathItem
*/
$ref?: string;
/**
* An optional, string summary, intended to apply to all operations in this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiPathItem
*/
summary?: string;
/**
* An optional, string description, intended to apply to all operations in this path.
* CommonMark syntax MAY be used for rich text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiPathItem
*/
description?: string;
/**
* A definition of a GET operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
get?: IApiOperation;
/**
* A definition of a PUT operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
put?: IApiOperation;
/**
* A definition of a POST operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
post?: IApiOperation;
/**
* A definition of a DELETE operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
delete?: IApiOperation;
/**
* A definition of a OPTIONS operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
options?: IApiOperation;
/**
* A definition of a HEAD operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
head?: IApiOperation;
/**
* A definition of a PATCH operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
patch?: IApiOperation;
/**
* A definition of a TRACE operation on this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiOperation}
* @memberof IApiPathItem
*/
trace?: IApiOperation;
/**
* An alternative server array to service all operations in this path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiServer[]}
* @memberof IApiPathItem
*/
servers?: IApiServer[];
/**
* 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 MUST NOT include duplicated parameters.
* A unique parameter is defined by a combination of a name and location. The list
* can use the Reference Object to link to parameters that are defined at the OpenAPI
* Object's components/parameters.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {((IApiParameter | IApiReference)[])}
* @memberof IApiPathItem
*/
parameters?: (IApiParameter | IApiReference)[];
}
/**
* Describes a single API operation on a path.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiOperation
*/
export interface IApiOperation {
/**
* A list of tags for API documentation control. Tags can be used for
* logical grouping of operations by resources or any other qualifier.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string[]}
* @memberof IApiOperation
*/
tags?: string[];
/**
* A short summary of what the operation does.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiOperation
*/
summary?: string;
/**
* A verbose explanation of the operation behavior. CommonMark syntax
* MAY be used for rich text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiOperation
*/
description?: string;
/**
* Additional external documentation for this operation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiExternalDocumentation}
* @memberof IApiOperation
*/
externalDocs?: IApiExternalDocumentation;
/**
* Unique string used to identify the operation. The id MUST be unique among all
* operations described in the API. The operationId value is case-sensitive. Tools
* and libraries MAY use the operationId to uniquely identify an operation, therefore,
* it is RECOMMENDED to follow common programming naming conventions.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiOperation
*/
operationId?: string;
/**
* A list of parameters that are applicable for this operation. If a parameter is already
* defined at the Path Item, the new definition will override it but can never remove it.
* The list MUST NOT include duplicated parameters. A unique parameter is defined by a
* combination of a name and location. The list can use the Reference Object to link to
* parameters that are defined at the OpenAPI Object's components/parameters.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {((IApiParameter | IApiReference)[])}
* @memberof IApiOperation
*/
parameters?: (IApiParameter | IApiReference)[];
/**
* The request body applicable for this operation. The requestBody is only supported in
* HTTP methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics
* for request bodies. In other cases where the HTTP spec is vague, requestBody SHALL be
* ignored by consumers.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {(IApiRequestBody | IApiReference)}
* @memberof IApiOperation
*/
requestBody?: IApiRequestBody | IApiReference;
/**
* The list of possible responses as they are returned from executing this operation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiResponse[]}
* @memberof IApiOperation
*/
responses: IApiResponses;
/**
* A map of possible out-of band callbacks related to the parent operation. The key is a
* unique identifier for the Callback Object. Each value in the map is a Callback Object
* that describes a request that may be initiated by the API provider and the expected
* responses. The key value used to identify the callback object is an expression, evaluated
* at runtime, that identifies a URL to use for the callback operation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {({
* [key: string]: IApiCallback | IApiReference;
* })}
* @memberof IApiOperation
*/
callbacks?: {
[key: string]: IApiCallback | IApiReference;
};
/**
* Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the
* declared operation. Default value is false.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {boolean}
* @memberof IApiOperation
*/
deprecated?: boolean;
/**
* A declaration of which security mechanisms can be used for this operation. The list of
* values includes alternative security requirement objects that can be used. Only one of
* the security requirement objects need to be satisfied to authorize a request. This
* definition overrides any declared top-level security. To remove a top-level security
* declaration, an empty array can be used.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiSecurityRequirement[]}
* @memberof IApiOperation
*/
security?: IApiSecurityRequirement[];
/**
* An alternative server array to service this operation. If an alternative server object
* is specified at the Path Item Object or Root level, it will be overridden by this value.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {IApiServer[]}
* @memberof IApiOperation
*/
servers?: IApiServer[];
}
/**
* Allows referencing an external resource for extended documentation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiExternalDocumentation
*/
export interface IApiExternalDocumentation {
/**
* A short description of the target documentation. CommonMark syntax MAY be used for
* rich text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiExternalDocumentation
*/
description?: string;
/**
* The URL for the target documentation. Value MUST be in the format of a URL.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiExternalDocumentation
*/
url: string;
}
export interface IApiAbstractParameter {
/**
* The name of the parameter. Parameter names are case sensitive.
* * If in is "path", the name field MUST correspond to the associated path segment
* from the path field in the Paths Object. See Path Templating for further information.
* * If in is "header" and the name field is "Accept", "Content-Type" or "Authorization",
* the parameter definition SHALL be ignored.
* * For all other cases, the name corresponds to the parameter name used by the in property.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiAbstractParameter
*/
name: string;
/**
* The location of the parameter. Possible values are "query", "header", "path" or "cookie".
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {('query'|'header'|'path'|'cookie')}
* @memberof IApiAbstractParameter
*/
in: 'query'|'header'|'path'|'cookie';
/**
* A brief description of the parameter. This could contain examples of use. CommonMark
* syntax MAY be used for rich text representation.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiAbstractParameter
*/
description?: string;
/**
* Determines whether this parameter is mandatory. If the parameter location is "path",
* this property is REQUIRED and its value MUST be true. Otherwise, the property MAY be
* included and its default value is false.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {boolean}
* @memberof IApiAbstractParameter
*/
required?: boolean;
/**
* Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
* Default value is false.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {boolean}
* @memberof IApiAbstractParameter
*/
deprecated?: boolean;
/**
* Describes how the parameter value will be serialized depending on the type of the
* parameter value. Default values (based on value of in): for query - form;
* for path - simple; for header - simple; for cookie - form.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {string}
* @memberof IApiAbstractParameter
*/
style?: 'matrix'|'label'|'form'|'simple'|'spaceDelimited'|'pipeDelimited'|'deepObject';
/**
* When this is true, parameter values of type array or object generate separate
* parameters for each value of the array or key-value pair of the map. For other
* types of parameters this property has no effect. When style is form, the default
* value is true. For all other styles, the default value is false.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {boolean}
* @memberof IApiAbstractParameter
*/
explode?: boolean;
/**
* The schema defining the type used for the parameter.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {(IApiSchema | IApiReference)}
* @memberof IApiAbstractParameter
*/
schema?: IApiSchema | IApiReference;
/**
* Example of the media type. The example SHOULD match the specified schema and encoding
* properties if present. The example field is mutually exclusive of the examples field.
* Furthermore, if referencing a schema which contains an example, the example value SHALL
* override the example provided by the schema. To represent examples of media types that
* cannot naturally be represented in JSON or YAML, a string value can contain the example
* with escaping where necessary.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {*}
* @memberof IApiAbstractParameter
*/
example?: any;
/**
* Examples of the media type. Each example SHOULD contain a value in the correct format as
* specified in the parameter encoding. The examples field is mutually exclusive of the
* example field. Furthermore, if referencing a schema which contains an example, the examples
* value SHALL override the example provided by the schema.
*
* @type {({
* [key: string]: IApiExample | IApiReference;
* })}
* @memberof IApiAbstractParameter
*/
examples?: {
[key: string]: IApiExample | IApiReference;
};
/**
* A map containing the representations for the parameter. The key is the media type and the
* value describes it. The map MUST only contain one entry.
*
* @type {{
* [key: string]: IApiMediaType;
* }}
* @memberof IApiAbstractParameter
*/
content?: {
[key: string]: IApiMediaType;
};
}
export interface IApiPathParameter extends IApiAbstractParameter {
in: 'path';
required: true;
style?: 'matrix'|'label'|'simple';
}
export interface IApiQueryParameter extends IApiAbstractParameter {
in: 'query';
/**
* Sets the ability to pass empty-valued parameters. This is valid only for query parameters
* and allows sending a parameter with an empty value. Default value is false. If style is
* used, and if behavior is n/a (cannot be serialized), the value of allowEmptyValue SHALL
* be ignored. Use of this property is NOT RECOMMENDED, as it is likely to be removed in a
* later revision.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {boolean}
* @memberof IApiAbstractParameter
*/
allowEmptyValue?: boolean;
/**
* Determines whether the parameter value SHOULD allow reserved characters, as defined by
* RFC3986 :/?#[]@!$&'()*+,;= to be included without percent-encoding. This property only
* applies to parameters with an in value of query. The default value is false.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @type {boolean}
* @memberof IApiQueryParameter
*/
allowReserved?: boolean;
style?: 'form'|'spaceDelimited'|'pipeDelimited'|'deepObject';
}
export interface IApiHeaderParameter extends IApiAbstractParameter {
in: 'header';
style?: 'simple';
}
export interface IApiCookieParameter extends IApiAbstractParameter {
in: 'cookie';
style?: 'form';
}
/**
* Describes a single operation parameter.
*
* A unique parameter is defined by a combination of a name and location.
*
* Parameter Locations
* There are four possible parameter locations specified by the in field:
*
* * path - Used together with Path Templating, where the parameter value is actually part
* of the operation's URL. This does not include the host or base path of the API. For example,
* in /items/{itemId}, the path parameter is itemId.
* * query - Parameters that are appended to the URL. For example, in /items?id=###, the query
* parameter is id.
* * header - Custom headers that are expected as part of the request. Note that RFC7230 states
* header names are case insensitive.
* * cookie - Used to pass a specific cookie value to the API.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
*/
export type IApiParameter = IApiPathParameter | IApiQueryParameter | IApiHeaderParameter | IApiCookieParameter;
/**
* Describes a single request body.
*
* Source: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
*
* @export
* @interface IApiRequestBody
*/
export interface IApiRequestBody {
/**