Open ngaya-ll opened 4 years ago
https://github.com/Yelp/swagger_spec_validator/pull/138 added support for boolean additionalProperties
which invalidates one of the test cases in this PR. I'm not sure whether this is correct as the Swagger 2.0 spec is a bit vague about that, see https://github.com/OAI/OpenAPI-Specification/issues/668.
I'll try to have a look to the PR and the Specifications later this evening.
For what I remember the schemas defined in #/definitions/<key>
must be dictionaries, and the PR seems ensuring this but I'm not 100% sure. So I need to validate this and check the code change.
@ngaya-ll thanks for the PR and for holding tight with us until a proper review is possible.
I remember us looking into additionalProperties
and the fact that it can be a boolean value in the past, it just slipped through during the code review for #134. OAI/OpenAPI-Specification#668 mentions that (more explicit) support for a boolean value was added in OpenAPI 3.0. See OAI/OpenAPI-Specification#894.
Given all of that, we should allow boolean values for additionalProperties
in OpenAPI 2.0.
This prevents an
AttributeError
when validating definitions like this: