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

Bugfix that enables rendering additionalProperties set to true. #597

Merged
merged 2 commits into from
Aug 7, 2018
Merged

Bugfix that enables rendering additionalProperties set to true. #597

merged 2 commits into from
Aug 7, 2018

Conversation

m-mohr
Copy link
Contributor

@m-mohr m-mohr commented Aug 7, 2018

Solves issue #596.

Copy link
Member

@RomanHotsiy RomanHotsiy left a comment

Choose a reason for hiding this comment

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

Except the comment I left could you aslo update line 254 to not pass true as a schema. Pass empty object if additionalProps is true:

schema: additionalProps === true ? {} : additionalProps

@@ -244,7 +244,7 @@ function buildFields(
sortByRequired(fields, schema.required);
}

if (typeof additionalProps === 'object') {
if (typeof additionalProps === 'object' || typeof additionalProps === 'boolean') {
Copy link
Member

Choose a reason for hiding this comment

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

if additionalProperties === false you should not push "additional properties" field, change this to checking if it is implicit true:

if (typeof additionalProps === 'object' || additionalProps === true) {

@m-mohr
Copy link
Contributor Author

m-mohr commented Aug 7, 2018

@RomanGotsiy Yes, that makes sense! Thanks for the review. Applied your suggestions, please re-check.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.242% when pulling ef3c532 on m-mohr:additional-properties into 568ce74 on Rebilly:master.

Copy link
Contributor Author

@m-mohr m-mohr left a comment

Choose a reason for hiding this comment

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

Implemented.

@RomanHotsiy RomanHotsiy merged commit f70ac08 into Redocly:master Aug 7, 2018
@RomanHotsiy
Copy link
Member

Nice 👍
Thanks!

@m-mohr m-mohr deleted the additional-properties branch August 7, 2018 10:40
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.

3 participants