File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
packages/openapi-typescript/src/transform Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,13 @@ export function defaultSchemaObjectTransform(schemaObject: SchemaObject | Refere
51
51
if ( schemaObject . enum ) {
52
52
let items = schemaObject . enum as any [ ] ;
53
53
if ( "type" in schemaObject ) {
54
- if ( schemaObject . type === "string" || ( Array . isArray ( schemaObject . type ) && schemaObject . type . includes ( "string" ) ) ) items = items . map ( ( t ) => escStr ( t || "" ) ) ; // empty/missing values are empty strings
54
+ if ( schemaObject . type === "string" || ( Array . isArray ( schemaObject . type ) && schemaObject . type . includes ( "string" ) ) ) items = items . map ( ( t ) => escStr ( t ) ) ; // empty/missing values are empty strings
55
55
}
56
56
// if no type, assume "string"
57
57
else {
58
58
items = items . map ( ( t ) => escStr ( t || "" ) ) ;
59
59
}
60
- return tsUnionOf ( ...items , ...( schemaObject . nullable || ( "type" in schemaObject && Array . isArray ( schemaObject . type ) && schemaObject . type . includes ( "null" ) ) ? [ "null" ] : [ ] ) ) ;
60
+ return tsUnionOf ( ...items , ...( schemaObject . nullable ? [ "null" ] : [ ] ) ) ;
61
61
}
62
62
63
63
// oneOf (no discriminator)
You can’t perform that action at this time.
0 commit comments