File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,9 @@ export function transformSchemaObj(node: any, options: Options): string {
137
137
let additionalProperties : string | undefined ;
138
138
if ( node . additionalProperties || ( node . additionalProperties === undefined && options . version === 3 ) ) {
139
139
if ( ( node . additionalProperties ?? true ) === true || Object . keys ( node . additionalProperties ) . length === 0 ) {
140
- additionalProperties = `{ ${ readonly } [key: string]: unknown }` ;
140
+ if ( ! ( node . type == null && isAnyOfOrOneOfOrAllOf ) ) {
141
+ additionalProperties = `{ ${ readonly } [key: string]: unknown }` ;
142
+ }
141
143
} else if ( typeof node . additionalProperties === "object" ) {
142
144
const oneOf : any [ ] | undefined = ( node . additionalProperties as any ) . oneOf || undefined ; // TypeScript does a really bad job at inference here, so we enforce a type
143
145
const anyOf : any [ ] | undefined = ( node . additionalProperties as any ) . anyOf || undefined ; // "
@@ -146,8 +148,9 @@ export function transformSchemaObj(node: any, options: Options): string {
146
148
} else if ( anyOf ) {
147
149
additionalProperties = `{ ${ readonly } [key: string]: ${ transformAnyOf ( anyOf , options ) } ; }` ;
148
150
} else {
149
- additionalProperties = `{ ${ readonly } [key: string]: ${ transformSchemaObj ( node . additionalProperties , options ) || "any"
150
- } ; }`;
151
+ additionalProperties = `{ ${ readonly } [key: string]: ${
152
+ transformSchemaObj ( node . additionalProperties , options ) || "any"
153
+ } ; }`;
151
154
}
152
155
}
153
156
}
You can’t perform that action at this time.
0 commit comments