Skip to content

Commit df58a5a

Browse files
authored
fix: treat undefined additionalProperties same false
as mentioned mtennoe#86 (comment) treat additionalProperties === undefined the same way as additionalProperties === false
1 parent 9767aa0 commit df58a5a

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/type-mappers/object.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,12 @@ export function extractAdditionalPropertiesType(
3232
if (swaggerType.type && swaggerType.type !== "object") {
3333
return undefined;
3434
}
35-
if (swaggerType.additionalProperties === false) {
36-
return undefined;
37-
}
3835
if (
39-
swaggerType.additionalProperties === undefined ||
40-
swaggerType.additionalProperties === true
36+
swaggerType.additionalProperties === false ||
37+
swaggerType.additionalProperties === true ||
38+
swaggerType.additionalProperties === undefined
4139
) {
42-
// is there an easier way to make an "any" type?
43-
return makeAnyTypeSpec({
44-
type: "object",
45-
required: [],
46-
minItems: 0,
47-
title: "any",
48-
properties: {}
49-
});
40+
return undefined;
5041
}
5142
return convertType(swaggerType.additionalProperties, swagger);
5243
}

0 commit comments

Comments
 (0)