-
Notifications
You must be signed in to change notification settings - Fork 3
/
components.yaml
2407 lines (2403 loc) · 63.1 KB
/
components.yaml
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
components:
schemas:
readOnlyObject:
type: object
properties:
string:
type: string
readOnly: true
example: "hello"
bool:
type: boolean
readOnly: true
example: true
num:
type: number
readOnly: true
example: 1.0
required:
- string
- bool
- num
writeOnlyObject:
type: object
properties:
string:
type: string
writeOnly: true
example: "hello"
bool:
type: boolean
writeOnly: true
example: true
num:
type: number
writeOnly: true
example: 1.0
required:
- string
- bool
- num
readWriteObject:
type: object
properties:
num1:
type: integer
writeOnly: true
example: 1
num2:
type: integer
writeOnly: true
example: 2
num3:
type: integer
example: 4
sum:
type: integer
readOnly: true
example: 7
required:
- num1
- num2
- num3
- sum
collectionOneOfObject:
oneOf:
- type: object
additionalProperties: true
example:
allow: true
user_is_admin: true
user_is_granted: []
- type: array
items: {}
stronglyTypedOneOfObject:
oneOf:
- $ref: "#/components/schemas/simpleObjectWithType"
- $ref: "#/components/schemas/deepObjectWithType"
discriminator:
propertyName: type
stronglyTypedOneOfObjectWithNonStandardDiscriminatorName:
oneOf:
- $ref: "#/components/schemas/simpleObjectWithNonStandardTypeName"
- $ref: "#/components/schemas/deepObjectWithNonStandardTypeName"
discriminator:
propertyName: 'obj.type'
stronglyTypedOneOfDiscriminatedObject:
oneOf:
- $ref: "#/components/schemas/taggedObject1"
- $ref: "#/components/schemas/taggedObject2"
- $ref: "#/components/schemas/taggedObject3"
discriminator:
propertyName: tag
mapping:
tag3: "#/components/schemas/taggedObject3"
tag1: "#/components/schemas/taggedObject1"
tag2: "#/components/schemas/taggedObject2"
constDiscriminatedOneOf:
oneOf:
- $ref: "#/components/schemas/constObject1"
- $ref: "#/components/schemas/constObject2"
discriminator:
propertyName: tag
mapping:
tag1: "#/components/schemas/constObject1"
tag2: "#/components/schemas/constObject2"
constObject1:
type: object
properties:
tag:
const: tag1
imageURL:
type: string
required:
- tag
- imageURL
constObject2:
type: object
properties:
tag:
const: tag2
profileId:
type: string
required:
- tag
- profileId
## test generation when objects are members of multiple
## oneOf definitions
Vehicle:
oneOf:
- $ref: '#/components/schemas/Car'
- $ref: '#/components/schemas/Bike'
discriminator:
propertyName: vehicleType
mapping:
car: '#/components/schemas/Car'
bike: '#/components/schemas/Bike'
HasWheels:
oneOf:
- $ref: '#/components/schemas/Car'
- $ref: '#/components/schemas/Bike'
discriminator:
propertyName: wheelsType
mapping:
four: '#/components/schemas/Car'
two: '#/components/schemas/Bike'
Car:
type: object
properties:
vehicleType:
type: string
const: car
wheelsType:
type: string
const: four
required: [vehicleType, wheelsType]
Bike:
type: object
properties:
vehicleType:
type: string
const: bike
wheelsType:
type: string
const: two
colour:
type: string
required: [vehicleType, wheelsType, colour]
infectedWithAny:
type: object
required: [data]
properties:
data:
oneOf:
- $ref: "#/components/schemas/simpleObject"
- $ref: "#/components/schemas/deepObject"
- type: object
x-speakeasy-type-override: any
unionOfArrays:
oneOf:
- type: array
items:
type: object
required: [foo]
properties:
foo:
type: string
x-speakeasy-name-override: foos
- type: array
items:
type: object
required: [bar]
properties:
bar:
type: string
- type: array
items:
type: object
required: [baz]
properties:
baz:
type: string
mixedUnionTypes:
oneOf:
- $ref: "#/components/schemas/Bike"
- type: array
items:
$ref: "#/components/schemas/Bike"
weaklyTypedOneOfObject:
oneOf:
- $ref: "#/components/schemas/simpleObject"
- $ref: "#/components/schemas/deepObject"
weaklyTypedOneOfNullEnumObject:
oneOf:
- $ref: "#/components/schemas/simpleObject"
- $ref: "#/components/schemas/deepObject"
- enum: [null]
weaklyTypedOneOfReadOnlyObject:
oneOf:
- $ref: "#/components/schemas/simpleObject"
- $ref: "#/components/schemas/readOnlyObject"
weaklyTypedOneOfWriteOnlyObject:
oneOf:
- $ref: "#/components/schemas/simpleObject"
- $ref: "#/components/schemas/writeOnlyObject"
weaklyTypedOneOfReadWriteObject:
oneOf:
- $ref: "#/components/schemas/simpleObject"
- $ref: "#/components/schemas/readWriteObject"
oneOfPrimitives:
oneOf:
- type: boolean
- type: string
oneOfOverlappingObjects:
oneOf:
- type: object
title: obj1
required:
- field1
properties:
field1:
type: string
- type: object
title: obj2
required:
- field1
- field2
properties:
field1:
type: string
field2:
type: boolean
objectWithNullEnums:
type: object
required: [nullEnum]
properties:
nullEnum:
enum: [null]
optNullEnum:
enum: [null]
typedObjectOneOf:
oneOf:
- $ref: "#/components/schemas/typedObject1"
- $ref: "#/components/schemas/typedObject2"
- $ref: "#/components/schemas/typedObject3"
typedObjectNullableOneOf:
oneOf:
- $ref: "#/components/schemas/typedObject1"
- $ref: "#/components/schemas/typedObject2"
- type: "null"
flattenedTypedObject1:
oneOf:
- $ref: "#/components/schemas/typedObject1"
nullableTypedObject1:
oneOf:
- $ref: "#/components/schemas/typedObject1"
- type: "null"
typedObject1:
type: object
properties:
type:
type: string
enum:
- "obj1"
value:
type: string
required:
- type
- value
typedObject2:
type: object
properties:
type:
type: string
enum:
- "obj2"
value:
type: string
required:
- type
- value
typedObject3:
type: object
properties:
type:
type: string
enum:
- "obj3"
value:
type: string
required:
- type
- value
taggedObject1:
type: object
properties:
tag:
type: string
enum: [tag1]
imageURL:
type: string
required:
- tag
- imageURL
taggedObject2:
type: object
properties:
tag:
type: string
enum: [tag2]
profileId:
type: string
required:
- tag
- profileId
taggedObject3:
type: object
properties:
tag:
type: string
const: tag3
phone:
type: string
required:
- tag
- phone
httpBinSimpleJsonObject:
type: object
properties:
slideshow:
type: object
properties:
author:
type: string
date:
type: string
title:
type: string
slides:
type: array
items:
type: object
properties:
title:
type: string
type:
type: string
items:
type: array
items:
type: string
required:
- title
- type
required:
- author
- date
- title
- slides
required:
- slideshow
enum:
type: string
description: "A string based enum"
enum:
- "one"
- "two"
- "three"
- "four_and_more"
example: "one"
enumArray:
type: array
items:
$ref: "#/components/schemas/enum"
enumMap:
type: object
additionalProperties:
$ref: "#/components/schemas/enum"
nestedEnumArray:
type: object
properties:
tags:
type: string
enums:
$ref: "#/components/schemas/enumArray"
required:
- tags
- enums
nestedEnumMap:
type: object
properties:
enums:
$ref: "#/components/schemas/enumMap"
required:
- enums
arrayOfDiscriminatedUnions:
type: array
items:
$ref: "#/components/schemas/stronglyTypedOneOfObject"
arrayOfDiscriminatedUnionsMap:
type: object
properties:
arrayMap:
type: object
additionalProperties:
$ref: "#/components/schemas/arrayOfDiscriminatedUnions"
required:
- arrayMap
nestedArrayOfDiscriminatedUnions:
type: object
properties:
nestedArray:
type: array
items:
$ref: "#/components/schemas/arrayOfDiscriminatedUnions"
required:
- nestedArray
simpleObject:
description: "A simple object that uses all our supported primitive types and enums and has optional properties."
externalDocs:
description: "A link to the external docs."
url: "https://speakeasy.com/docs"
type: object
properties:
str:
type: string
description: "A string property."
example: "test"
bool:
type: boolean
description: "A boolean property."
example: true
int:
type: integer
description: "An integer property."
example: 1
int32:
type: integer
format: int32
description: "An int32 property."
example: 1
num:
type: number
description: "A number property."
example: 1.1
float32:
type: number
format: float
description: "A float32 property."
example: 1.1
enum:
$ref: "#/components/schemas/enum"
date:
type: string
format: date
description: "A date property."
example: "2020-01-01"
dateTime:
type: string
format: date-time
description: "A date-time property."
example: "2020-01-01T00:00:00.001Z"
any:
description: "An any property."
example: "any"
strOpt:
type: string
description: "An optional string property."
example: "testOptional"
boolOpt:
type: boolean
description: "An optional boolean property."
example: true
intOptNull:
type: integer
description: "An optional integer property will be null for tests."
numOptNull:
type: number
description: "An optional number property will be null for tests."
intEnum:
type: integer
description: "An integer enum property."
enum:
- 1
- 2
- 3
example: 2
x-speakeasy-enum-format: enum
x-speakeasy-enums:
- First
- Second
- Third
int32Enum:
type: integer
format: int32
description: "An int32 enum property."
enum:
- 55
- 69
- 181
example: 55
bigint:
type: integer
format: bigint
example: 8821239038968084
bigintStr:
type: string
format: bigint
example: "9223372036854775808"
decimal:
type: number
format: decimal
example: 3.141592653589793
decimalStr:
type: string
format: decimal
example: "3.14159265358979344719667586"
decimalNullableOpt:
type: [number, "null"]
format: decimal
int64Str:
type: string
format: int64
description: An int64 string
example: "100"
float64Str:
type: string
format: float64
description: A float64 string
example: "1.1"
required:
- str
- bool
- int
- int32
- num
- float32
- enum
- date
- dateTime
- any
- intEnum
- int32Enum
simpleObjectCamelCase:
description: "A simple object that uses all our supported primitive types and enums and has optional properties."
externalDocs:
description: "A link to the external docs."
url: "https://speakeasy.com/docs"
type: object
properties:
str_val:
type: string
description: "A string property."
example: "example"
bool_val:
type: boolean
description: "A boolean property."
example: true
int_val:
type: integer
description: "An integer property."
example: 999999
int32_val:
type: integer
format: int32
description: "An int32 property."
example: 1
num_val:
type: number
description: "A number property."
example: 1.1
float32_val:
type: number
format: float
description: "A float32 property."
example: 2.2222222
enum_val:
$ref: "#/components/schemas/enum"
date_val:
type: string
format: date
description: "A date property."
example: "2020-01-01"
date_time_val:
type: string
format: date-time
description: "A date-time property."
example: "2020-01-01T00:00:00.001Z"
any_val:
description: "An any property."
example: "any example"
str_opt_val:
type: string
description: "An optional string property."
example: "optional example"
bool_opt_val:
type: boolean
description: "An optional boolean property."
example: true
int_opt_null_val:
type: integer
description: "An optional integer property will be null for tests."
example: 999999
num_opt_null_val:
type: number
description: "An optional number property will be null for tests."
example: 1.1
int_enum_val:
type: integer
description: "An integer enum property."
enum:
- 1
- 2
- 3
example: 3
x-speakeasy-enum-format: enum
x-speakeasy-enums:
- First
- Second
- Third
int32_enum_val:
type: integer
format: int32
description: "An int32 enum property."
enum:
- 55
- 69
- 181
example: 69
bigint_val:
type: integer
format: bigint
bigint_str_val:
type: string
format: bigint
decimal_val:
type: number
format: decimal
required:
- str_val
- bool_val
- int_val
- int32_val
- num_val
- float32_val
- enum_val
- date_val
- date_time_val
- any_val
- int_enum_val
- int32_enum_val
simpleObjectWithType:
allOf:
- $ref: "#/components/schemas/simpleObject"
- type: object
properties:
type:
type: string
required:
- type
simpleObjectWithNonStandardTypeName:
allOf:
- $ref: "#/components/schemas/simpleObject"
- type: object
properties:
'obj.type':
type: string
required:
- 'obj.type'
deepObject:
type: object
properties:
str:
type: string
example: "test"
bool:
type: boolean
example: true
int:
type: integer
example: 1
num:
type: number
example: 1.1
obj:
$ref: "#/components/schemas/simpleObject"
map:
type: object
additionalProperties:
$ref: "#/components/schemas/simpleObject"
example: { "key": "...", "key2": "..." }
arr:
type: array
items:
$ref: "#/components/schemas/simpleObject"
example: ["...", "..."]
any:
anyOf:
- $ref: "#/components/schemas/simpleObject"
- type: string
example: "anyOf[0]"
type:
type: string
required:
- str
- bool
- int
- num
- obj
- map
- arr
- any
deepObjectQueryParams:
description: >
deepObject style query parameter serialization is undefined for
arrays or nested objects by the specification:
https://github.com/OAI/OpenAPI-Specification/issues/1706
This schema covers the intended implementation cases rather than
the fully complex deepObject schema.
type: object
properties:
arr:
type: array
items:
type: string
example: ["test1", "test2"]
bool:
type: boolean
example: true
int:
type: integer
example: 1
map:
type: object
additionalProperties:
type: string
example: {"testkey1": "testvalue1", "testkey2": "testvalue2"}
num:
type: number
example: 1.1
obj:
$ref: "#/components/schemas/simpleObject"
oneof:
oneOf:
- type: string
example: test
- type: integer
oneofnestedobject:
oneOf:
- type: string
- type: object
properties:
nested:
type: string
example: test
str:
type: string
example: "test"
required:
- arr
- bool
- int
- map
- num
- obj
- str
deepObjectSmaller:
type: object
properties:
str:
type: string
example: "test"
bool:
type: boolean
example: true
int:
type: integer
example: 1
num:
type: number
example: 1.1
obj:
$ref: "#/components/schemas/simpleObject"
map:
type: object
additionalProperties:
$ref: "#/components/schemas/simpleObject"
example: { "key": "..." }
arr:
type: array
items:
$ref: "#/components/schemas/simpleObject"
example: ["...", "..."]
any:
anyOf:
- $ref: "#/components/schemas/simpleObject"
- type: string
example: "anyOf[0]"
type:
type: string
required:
- str
- bool
- int
- num
- obj
- map
- arr
- any
deepObjectCamelCase:
type: object
properties:
str_val:
type: string
example: "test"
bool_val:
type: boolean
example: true
int_val:
type: integer
example: 1
num_val:
type: number
example: 1.1
obj_val:
$ref: "#/components/schemas/simpleObjectCamelCase"
map_val:
type: object
additionalProperties:
$ref: "#/components/schemas/simpleObjectCamelCase"
example: { "key": "..." }
arr_val:
type: array
items:
$ref: "#/components/schemas/simpleObjectCamelCase"
example: ["...", "..."]
any_val:
anyOf:
- $ref: "#/components/schemas/simpleObjectCamelCase"
- type: string
type:
type: string
required:
- str_val
- bool_val
- int_val
- num_val
- obj_val
- map_val
- arr_val
- any_val
deepObjectWithType:
allOf:
- $ref: "#/components/schemas/deepObject"
- type: object
properties:
type:
type: string
deepObjectWithNonStandardTypeName:
allOf:
- $ref: "#/components/schemas/deepObject"
- type: object
properties:
'obj.type':
type: string
complexNumberArrays:
type: object
properties:
bigintArray:
type: array
items:
type: integer
format: bigint
bigintStrArray:
type: array
items:
type: string
format: bigint
decimalArray:
type: array
items:
type: number
format: decimal
decimalStrArray:
type: array
items:
type: string
format: decimal
complexNumberMaps:
type: object
properties:
bigintMap:
type: object
additionalProperties:
type: integer
format: bigint
bigintStrMap:
type: object
additionalProperties:
type: string
format: bigint
decimalMap:
type: object
additionalProperties:
type: number
format: decimal
decimalStrMap:
type: object
additionalProperties:
type: string
format: decimal
fakerFormattedStrings:
type: object
description: A set of strings with format values that lead to relevant examples being generated for them
properties:
dateFormat:
format: date
type: string
description: A field that will have RFC3339 formatted datestamp generated as example
datetimeFormat:
format: date-time
type: string
description: A field that will have RFC3339 formatted timestamp generated as example
imageFormat:
format: image
type: string
description: A field that will have a image url generated as example
addressFormat:
format: address
type: string
description: A field that will have an address generated as example
timezoneFormat:
format: timezone
type: string
description: A field that will have a timezone generated as example
zipcodeFormat:
format: zipcode
type: string
description: A field that will have a postal code generated as example
jsonFormat:
format: json
type: string
description: A field that will have a JSON generated as example
uuidFormat:
format: uuid
type: string
description: A field that will have a UUID generated as example
domainFormat:
format: domain
type: string
description: A field that will have a domain name generated as example
emailFormat:
format: email
type: string
description: A field that will have an email address generated as example
ipv4Format:
format: ipv4
type: string
description: A field that will have an IPv4 address generated as example
ipv6Format:
format: ipv6
type: string
description: A field that will have an IPv6 address generated as example
macFormat:
format: mac
type: string
description: A field that will have a MAC address generated as example
passwordFormat:
format: password
type: string
description: A field that will have a fake password generated as example
urlFormat:
format: url
type: string
description: A field that will have a URL generated as example
phoneFormat:
format: phone