-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix: treat undefined additionalProperties same false #131
base: master
Are you sure you want to change the base?
Conversation
as mentioned mtennoe#86 (comment) treat additionalProperties === undefined the same way as additionalProperties === false
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.
Hey, thanks for contributing! Added a couple questions :)
) { | ||
// 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 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?
if ( | ||
swaggerType.additionalProperties === undefined || | ||
swaggerType.additionalProperties === true | ||
swaggerType.additionalProperties === false || |
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.
Shouldn't the false-case be moved from this if check to the one on line 35 for false
?
@@ -32,21 +32,12 @@ export function extractAdditionalPropertiesType( | |||
if (swaggerType.type && swaggerType.type !== "object") { | |||
return undefined; | |||
} | |||
if (swaggerType.additionalProperties === false) { |
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?
as mentioned #86 (comment)
treat additionalProperties === undefined the same way as additionalProperties === false
Microsoft Reviewers: Open in CodeFlow