@@ -14,6 +14,7 @@ const options: TransformSchemaObjectOptions = {
14
14
operations : { } ,
15
15
pathParamsAsTypes : false ,
16
16
postTransform : undefined ,
17
+ parameters : { } ,
17
18
silent : true ,
18
19
supportArrayLength : false ,
19
20
transform : undefined ,
@@ -202,15 +203,15 @@ describe("Schema Object", () => {
202
203
const generated = transformSchemaObject ( schema , options ) ;
203
204
expect ( generated ) . toBe ( `{
204
205
property?: boolean;
205
- [key: string]: string | undefined ;
206
+ [key: string]: string;
206
207
}` ) ;
207
208
} ) ;
208
209
209
210
test ( "additionalProperties: true" , ( ) => {
210
211
const schema : SchemaObject = { type : "object" , additionalProperties : true } ;
211
212
const generated = transformSchemaObject ( schema , options ) ;
212
213
expect ( generated ) . toBe ( `{
213
- [key: string]: unknown | undefined ;
214
+ [key: string]: unknown;
214
215
}` ) ;
215
216
} ) ;
216
217
@@ -221,15 +222,15 @@ describe("Schema Object", () => {
221
222
} ;
222
223
const generated = transformSchemaObject ( schema , options ) ;
223
224
expect ( generated ) . toBe ( `{
224
- [key: string]: string | undefined ;
225
+ [key: string]: string;
225
226
}` ) ;
226
227
} ) ;
227
228
228
229
test ( "additionalProperties: {}" , ( ) => {
229
230
const schema : SchemaObject = { type : "object" , additionalProperties : { } } ;
230
231
const generated = transformSchemaObject ( schema , options ) ;
231
232
expect ( generated ) . toBe ( `{
232
- [key: string]: unknown | undefined ;
233
+ [key: string]: unknown;
233
234
}` ) ;
234
235
} ) ;
235
236
@@ -424,7 +425,7 @@ describe("Schema Object", () => {
424
425
} ) ;
425
426
expect ( generated ) . toBe ( `{
426
427
fixed: boolean;
427
- [key: string]: unknown | undefined ;
428
+ [key: string]: unknown;
428
429
}` ) ;
429
430
} ) ;
430
431
} ) ;
@@ -516,9 +517,9 @@ describe("Schema Object", () => {
516
517
ctx : { ...options . ctx , immutableTypes : true } ,
517
518
} ) ;
518
519
expect ( generated ) . toBe ( `{
519
- readonly array?: ( readonly ({
520
- [key: string]: unknown | undefined ;
521
- })[]) | null;
520
+ readonly array?: readonly ({
521
+ [key: string]: unknown;
522
+ })[] | null;
522
523
}` ) ;
523
524
} ) ;
524
525
} ) ;
0 commit comments