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

Support additionalProperties #16

Open
philipcristiano opened this issue Jun 15, 2020 · 1 comment
Open

Support additionalProperties #16

philipcristiano opened this issue Jun 15, 2020 · 1 comment

Comments

@philipcristiano
Copy link

philipcristiano commented Jun 15, 2020

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.

@mephinet
Copy link

mephinet commented Jan 11, 2022

I tried to come up with a pull request in order to support additionalProperties: #63

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

No branches or pull requests

2 participants