Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions src/type-mappers/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,12 @@ export function extractAdditionalPropertiesType(
if (swaggerType.type && swaggerType.type !== "object") {
return undefined;
}
if (swaggerType.additionalProperties === false) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test case for the updated behavior?

return undefined;
}
if (
swaggerType.additionalProperties === undefined ||
swaggerType.additionalProperties === true
swaggerType.additionalProperties === false ||
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the false-case be moved from this if check to the one on line 35 for false?

swaggerType.additionalProperties === true ||
swaggerType.additionalProperties === undefined
) {
// is there an easier way to make an "any" type?
return makeAnyTypeSpec({
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why are we doing this change and not keeping the same makeAnyTypeSpec behavior?

type: "object",
required: [],
minItems: 0,
title: "any",
properties: {}
});
return undefined;
}
return convertType(swaggerType.additionalProperties, swagger);
}
Expand Down