Skip to content

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 :)

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?

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?

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