openapi3
openapi3 copied to clipboard
Support additionalProperties
When calling an API that returns more data than specified in the OpenAPI spec, openapi3 fails:
File "[redacted]/lib/python3.7/site-packages/openapi3/openapi.py", line 189, in __call__
**kwargs)
File "[redacted]/lib/python3.7/site-packages/openapi3/paths.py", line 287, in request
return expected_media.schema.model(result.json())
File "[redacted]/lib/python3.7/site-packages/openapi3/schemas.py", line 113, in model
return self.get_type()(data, self)
File "[redacted]/lib/python3.7/site-packages/openapi3/schemas.py", line 173, in __init__
setattr(self, k, object_schema.model(v))
File "[redacted]/lib/python3.7/site-packages/openapi3/schemas.py", line 113, in model
return self.get_type()(data, self)
File "[redacted]/lib/python3.7/site-packages/openapi3/schemas.py", line 164, in __init__
prop = schema.properties[k]
KeyError: 'dynamic-property'
The API I'm calling relies on additionalProperties: True in the spec to return an object with dynamic values that are not known at the time of spec generation.
I tried to come up with a pull request in order to support additionalProperties: https://github.com/Dorthu/openapi3/pull/63