@@ -140,6 +140,7 @@ describe("types", () => {
140
140
type : "object" ,
141
141
} ,
142
142
object_unknown : { type : "object" } ,
143
+ object_empty : { } ,
143
144
} ,
144
145
} ,
145
146
} ;
@@ -154,6 +155,7 @@ describe("types", () => {
154
155
};
155
156
object_ref: { number?: number };
156
157
object_unknown: { [key: string]: any };
158
+ object_empty: { [key: string]: any };
157
159
}
158
160
}` )
159
161
) ;
@@ -179,6 +181,9 @@ describe("types", () => {
179
181
} ,
180
182
type : "object" ,
181
183
} ,
184
+ inferred_array : {
185
+ items : { $ref : "#/components/schemas/array" } ,
186
+ } ,
182
187
string : { type : "string" } ,
183
188
array_ref : {
184
189
items : { $ref : "#/components/schemas/array" } ,
@@ -198,6 +203,7 @@ describe("types", () => {
198
203
numbers?: number[];
199
204
refs?: components['schemas']['string'][];
200
205
};
206
+ inferred_array: components['schemas']['array'][];
201
207
string: string;
202
208
array_ref: components['schemas']['array'][];
203
209
}
@@ -377,7 +383,7 @@ describe("OpenAPI3 features", () => {
377
383
oneOf : [
378
384
{ type : "string" } ,
379
385
{ type : "number" } ,
380
- { $ref : "#/components/one_of_ref" } ,
386
+ { $ref : "#/components/schemas/ one_of_ref" } ,
381
387
] ,
382
388
} ,
383
389
} ,
@@ -389,6 +395,26 @@ describe("OpenAPI3 features", () => {
389
395
} ,
390
396
type : "object" ,
391
397
} ,
398
+ one_of_inferred : {
399
+ oneOf : [
400
+ {
401
+ properties : {
402
+ kibana : {
403
+ type : "object" ,
404
+ properties : { versions : { type : "string" } } ,
405
+ } ,
406
+ } ,
407
+ } ,
408
+ {
409
+ properties : {
410
+ elasticsearch : {
411
+ type : "object" ,
412
+ properties : { versions : { type : "string" } } ,
413
+ } ,
414
+ } ,
415
+ } ,
416
+ ] ,
417
+ } ,
392
418
} ,
393
419
} ,
394
420
} ;
@@ -397,8 +423,11 @@ describe("OpenAPI3 features", () => {
397
423
format ( `
398
424
export interface components {
399
425
schemas: {
400
- one_of: { options?: string | number | components['one_of_ref'] };
426
+ one_of: { options?: string | number | components['schemas'][' one_of_ref'] };
401
427
one_of_ref: { boolean?: boolean };
428
+ one_of_inferred:
429
+ | { kibana?: { versions?: string } }
430
+ | { elasticsearch?: { versions?: string } }
402
431
}
403
432
}` )
404
433
) ;
0 commit comments