Yelp / swagger_spec_validator

Other
104 stars 71 forks source link

validator errors when `additionalProperties: false` #137

Closed ymilki closed 4 years ago

ymilki commented 4 years ago

134 introduces a new code path that validates additionalProperties. However, it assumes that additionalProperties, if exists, is an object

jsonschema allows for boolean values: https://json-schema.org/understanding-json-schema/reference/object.html

The additionalProperties keyword may be either a boolean or an object. If additionalProperties is a boolean and set to false, no additional properties will be allowed.

Existing schemas with boolean values for additionalProperties are failing validation with: 'bool' object has no attribute 'get

v2.5.0 validates successfully. v2.7.0 fails. swagger.txt