About
Openapi-schema-validator is a Python library that validates schema against:
OpenAPI Schema Specification v3.0 which is an extended subset of the JSON Schema Specification Wright Draft 00.
OpenAPI Schema Specification v3.1 which is an extended superset of the JSON Schema Specification Draft 2020-12.
Installation
Recommended way (via pip):
$ pip install openapi-schema-validator
Alternatively you can download the code and install from the repository:
$ pip install -e git+https:/github.com/p1c2u/openapi-schema-validator.git#egg=openapi_schema_validator
Usage
By default, the latest OpenAPI schema syntax is expected.
To validate an OpenAPI v3.1 schema:
from openapi_schema_validator import validate
schema = {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"age": {
"type": ["integer", "null"],
"format": "int32",
"minimum": 0,
|