Skip to content

Support additionalProperties #16

@philipcristiano

Description

@philipcristiano

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions