-
Notifications
You must be signed in to change notification settings - Fork 53
fix: treat undefined additionalProperties same false #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,21 +32,12 @@ export function extractAdditionalPropertiesType( | |
| if (swaggerType.type && swaggerType.type !== "object") { | ||
| return undefined; | ||
| } | ||
| if (swaggerType.additionalProperties === false) { | ||
| return undefined; | ||
| } | ||
| if ( | ||
| swaggerType.additionalProperties === undefined || | ||
| swaggerType.additionalProperties === true | ||
| swaggerType.additionalProperties === false || | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| swaggerType.additionalProperties === true || | ||
| swaggerType.additionalProperties === undefined | ||
| ) { | ||
| // is there an easier way to make an "any" type? | ||
| return makeAnyTypeSpec({ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, why are we doing this change and not keeping the same |
||
| type: "object", | ||
| required: [], | ||
| minItems: 0, | ||
| title: "any", | ||
| properties: {} | ||
| }); | ||
| return undefined; | ||
| } | ||
| return convertType(swaggerType.additionalProperties, swagger); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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?