State explicitly: additionalProperties : true
is the default
#1548
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Address #715 - State (explicitly) whether Open API schema object definitions are open or closed for extension.
This was the topic of many discussions around OpenAPI 2.0 and earlier Swagger specifications. Here are some of them:
additionalProperties
can only have a schema value Make it clear thatadditionalProperties
can only have a schema value #668OpenAPI 2.0 assumed
additionalProperties: false
as the default, and disallowed explicit use of a booleanadditionalProperties
value. This was never fully documented, only stated in out-of-band comments. And those comments were never really reconciled withallOf
semantics, which magically continued to work as thoughadditionalProperties: true
were the default.I wasn't aware, and I'm guessing that some others also weren't aware, that this changed intentionally in the 3.0 spec. The current 3.0.1 spec explicitly states that boolean values are allowed, but doesn't explicitly state that the default is now
additionalProperties: true
.I think it's worth making this explicit now, because anyone who got caught up in the 2.0
additionalProperties
confusion is likely to need some assurance that this change is intentional, and not subject to informal amendments or clarifications made outside of the spec.@handrews and I were both looking for that assurance, and couldn't find it. So I'm suggesting this small change.