openapi-spec-validator
OpenAPI 2.0 (aka Swagger) and OpenAPI 3 spec validator
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a concrete problem for anyone working with OpenAPI specifications. The permissive Apache-2.0 license poses no restrictions. Install it if you need to validate OpenAPI specs in CI, pre-commit workflows, or application code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (supports 3.10 through 3.14).
- Low install friction with a pure-Python wheel distribution.
- Active maintenance with a recent release (86 days ago) and ongoing commits.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers.
last release 2026-05-20 (86 days) · last repo commit 2026-08-10 · 407 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 47,111,997 downloads/mo, #603 on PyPI
Alternatives
Verify before relying
from openapi_spec_validator import validate
from openapi_spec_validator.readers import read_from_filename
spec_dict, base_uri = read_from_filename('openapi.yaml')
validate(spec_dict)- Whether the optional jsonschema-rs backend provides meaningful performance gains for typical spec sizes.
- How the resolved-path cache tuning (OPENAPI_SPEC_VALIDATOR_RESOLVED_CACHE_MAXSIZE) affects validation speed on large or deeply nested specs.
What it is and what it does
OpenAPI Spec Validator checks whether your API specifications conform to the OpenAPI standard (Swagger 2.0, OpenAPI 3.0, 3.1, or 3.2). It works as a standalone CLI command, a Python library you can call from code, or a pre-commit hook to catch spec violations before they reach your repository. The validator uses jsonschema and pydantic under the hood to perform schema compliance checks and will raise an OpenAPIValidationError if required fields are missing or values violate the spec.
You can run it directly on a YAML or JSON file, pipe specs through stdin, or integrate it into your Python application's validation pipeline. It supports performance tuning via environment variables for cache sizing and schema validator backend selection, making it suitable for both small projects and large-scale API documentation workflows.
Use it for
- Validate API specs in CI/CD pipelines before deploying API documentation or code generation.
- Enforce OpenAPI compliance in pre-commit hooks to prevent invalid specs from being committed.
- Check spec validity programmatically in Python applications that generate or consume OpenAPI definitions.
- Audit existing API specifications for compliance with OpenAPI 3.0, 3.1, or 3.2 standards.
- Integrate spec validation into API gateway or documentation tooling workflows.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a concrete problem for anyone working with OpenAPI specifications. The permissive Apache-2.0 license poses no restrictions. Install it if you need to validate OpenAPI specs in CI, pre-commit workflows, or application code.
Install
openapi-spec-validator on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release (86 days ago) and ongoing commits. Depends on well-established schema validation libraries (jsonschema, pydantic) with no exotic system requirements.
Requires Python 3.10 or later (supports 3.10 through 3.14).
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and proprietary projects with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
from openapi_spec_validator import validate
from openapi_spec_validator.readers import read_from_filename
spec_dict, base_uri = read_from_filename('openapi.yaml')
validate(spec_dict)
Verify before relying
- Whether the optional jsonschema-rs backend provides meaningful performance gains for typical spec sizes.
- How the resolved-path cache tuning (OPENAPI_SPEC_VALIDATOR_RESOLVED_CACHE_MAXSIZE) affects validation speed on large or deeply nested specs.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release <4.0,>=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesjsonschemajsonschema-pathlazy-object-proxyopenapi-schema-validatorpydanticpydantic-settings |
| Maintenance | Actively maintained 86 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 47,111,997 / month, #603 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 :: DevelopersOperating 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_spec_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 › “openapi 3.0 validator”
- openapi-spec-validatorValidates OpenAPI specifications (versions 2.0, 3.0, 3.1, and 3.2)…
- openapi-schema-validatorValidates data and schemas against OpenAPI Schema Specification…
- prancePrance parses and validates Swagger/OpenAPI 2.0 and 3.0…
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-schema-validator · openapi3 · prance · pyvalid · swagger-spec-validator · openapi-core · aiopenapi3 · flex · bravado-core · openapi-schema-pydantic