Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohofo7
Copy link

@mohofo7 mohofo7 commented Oct 30, 2021

as mentioned #86 (comment)

treat additionalProperties === undefined the same way as additionalProperties === false

Microsoft Reviewers: Open in CodeFlow

as mentioned mtennoe#86 (comment)

treat additionalProperties === undefined the same way as additionalProperties === false
Copy link
Owner

@mtennoe mtennoe left a 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({
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?

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?

@@ -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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants