openapi-schema-validator
OpenAPI schema validation for Python
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, supports current Python versions, and fills a specific need for OpenAPI schema validation. Install it if you work with OpenAPI specs and need runtime validation; the low install friction and permissive license make it a straightforward choice. Consider it essential for API contract testing or spec-driven development.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (supports up to 3.14).
- Low install friction with a pure-Python wheel.
- Actively maintained as of 2026-07-20 with recent release activity.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive and imposes minimal restrictions; you may use, modify, and distribute this package freely in commercial and private projects provided you include the license notice.
last release 2026-04-27 (109 days) · last repo commit 2026-07-20 · 126 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 28,129,313 downloads/mo, #839 on PyPI
Alternatives
Verify before relying
pip install openapi-schema-validator
from openapi_schema_validator import validate
schema = {"type": "object", "properties": {"name": {"type": "string"}}}
validate({"name": "John"}, schema)- Performance characteristics and typical validation latency for large or deeply nested schemas.
- Behavior and limitations when resolving external $ref references with custom registries.
- Whether the optional ecma-regex extra is required for production use cases or only for ECMAScript pattern compliance.
What it is and what it does
openapi-schema-validator is a Python library that validates instances and schemas against the OpenAPI Schema Specification. It supports three major OpenAPI versions—3.0 (which extends JSON Schema Wright Draft 00), 3.1 (which extends JSON Schema Draft 2020-12), and 3.2 (which uses the published OAS 3.2 JSON Schema dialect)—allowing you to enforce schema compliance at runtime.
The package provides version-specific validator classes (OAS30Validator, OAS31Validator, OAS32Validator) and a unified validate() function that defaults to OAS32Validator. It handles reference resolution, format validation, and property enforcement, with options to skip schema checking in hot paths, control remote reference behavior, and enforce strict property presence for contract testing. It depends on jsonschema, pydantic, and related libraries for its core validation logic.
Use it for
- Validate API request and response payloads against OpenAPI schemas in a web service or client library.
- Enforce contract testing by validating that all documented schema properties are present in responses.
- Validate configuration or data files modeled as OpenAPI schemas in a CLI tool or data pipeline.
- Check schema compliance during API spec generation or migration between OpenAPI versions.
- Validate binary or complex data types (base64, arrays with prefixItems) according to OpenAPI 3.1+ semantics.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, supports current Python versions, and fills a specific need for OpenAPI schema validation. Install it if you work with OpenAPI specs and need runtime validation; the low install friction and permissive license make it a straightforward choice. Consider it essential for API contract testing or spec-driven development.
Install
openapi-schema-validator on PyPI
Before you install
Low install friction with a pure-Python wheel. Actively maintained as of 2026-07-20 with recent release activity. Depends on jsonschema, pydantic, and related validation libraries—all standard, well-maintained packages.
Requires Python 3.10 or later (supports up to 3.14).
License in practice
BSD-3-Clause is permissive and imposes minimal restrictions; you may use, modify, and distribute this package freely in commercial and private projects provided you include the license notice.
Quickstart
pip install openapi-schema-validator
from openapi_schema_validator import validate
schema = {"type": "object", "properties": {"name": {"type": "string"}}}
validate({"name": "John"}, schema)
Verify before relying
- Performance characteristics and typical validation latency for large or deeply nested schemas.
- Behavior and limitations when resolving external $ref references with custom registries.
- Whether the optional ecma-regex extra is required for production use cases or only for ECMAScript pattern compliance.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release <4.0.0,>=3.10.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesjsonschemajsonschema-specificationspydanticpydantic-settingsreferencingrfc3339-validator |
| Maintenance | Actively maintained 109 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 28,129,313 / month, #839 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: openapi_schema_validator-0.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “validate against openapi spec”
- openapi-schema-validatorValidates data and schemas against OpenAPI Schema Specification…
- swagger-spec-validatorValidates Swagger/OpenAPI specifications (versions 1.2 and 2.0)…
- openapi-spec-validatorValidates OpenAPI specifications (versions 2.0, 3.0, 3.1, and 3.2)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also openapi-core · openapi-spec-validator · voluptuous-openapi · swagger-spec-validator · openapi3 · prance · kubernetes-validate · pyvalid · flex · aiopenapi3