Python OpenAPI

Validate, document, and ship OpenAPI APIs in Python.

Three focused libraries — openapi-core, openapi-spec-validator, and openapi-schema-validator — covering runtime validation, document validation, and schema validation.

Pick the library that matches your job

  • Runtime API validation

    openapi-core

    Validate live HTTP requests and responses against an OpenAPI document inside your Python web application.

    Open openapi-core
  • Full document validation

    openapi-spec-validator

    Verify that an OpenAPI document conforms to the specification — ideal for CI lint steps and tooling.

    Open openapi-spec-validator
  • Schema validation

    openapi-schema-validator

    Validate JSON instances against OpenAPI Schema Objects with full draft-aware support.

    Open openapi-schema-validator

Three libraries, one ecosystem.

The Python OpenAPI projects are deliberately scoped so each library does one thing well. They are designed to compose, not to overlap.

  1. Runtime API validation

    openapi-core enforces request and response contracts inside your application using your OpenAPI document.

  2. Document validation

    openapi-spec-validator checks the OpenAPI document itself against the specification, catching mistakes before they ship.

  3. Schema validation

    openapi-schema-validator validates JSON instances against OpenAPI Schema Objects with the OpenAPI JSON Schema dialect.