Validate Request against OpenAPI YAML in Python

Viewed 581

I have written API documentation using Open API 3 standards (using stoplight.io). Now I'm implementing the API in Python 3.7, and I don't want to rewrite all of the schemas, not to mention I'd like my API to be coupled with my documentation to prevent discrepancies.

I've found tools like pydantic and openapi-schema-validator that seem relevant, but don't fit my use case. For example, pydantic wants me to create the pythonic objects first and then export to json_schema and openapi-schema-validator wants just the json schema while I have an Open API yaml.

This seems like a standard question, but I haven't found a good answer. Thanks!

1 Answers
Related