Skip to content

Validating schema with external references #5

@dlarrick

Description

@dlarrick

Greetings,
I am attempting to use openapi-schema-validator to validate a bare JSON object against a specific OpenAPI Model. This JSON is received by my application by GET from a remote API, similar to the case in python-openapi/openapi-core#154 .

However, the wrinkle is that the model I am trying to validate against has external refs. OpenAPI-Core itself (given a spec_url) is able to resolve these external refs, but I am struggling to find a method to validate bare models that doesn't involve making a fake request and path, as described in 154.

Is there a way to provide OpenAPI-Schema-Valdiator with a resolver that's capable of resolving external refs (filenames)?

Alternatively, is there a way to retrieve a fully-flattened model definition (with $refs expanded) from an existing OpenAPI spec? openapi_spec.get_schema('Modelname') returns the original model with refs in place.

Thanks in advance for any guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions