swagger-spec-validator
Validation of Swagger specifications
Decision gist · record as of 2026-08-14
Yes. The package is production-stable, actively maintained with recent commits, has low install friction, carries no known vulnerabilities, and solves a concrete problem in API development. Install it if you work with Swagger 1.2 or 2.0 specs and need programmatic validation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with four lightweight runtime dependencies (jsonschema, pyyaml, typing-extensions, importlib-resources).
- Actively maintained with recent commits and production-stable status.
License · maintenance · safety
Apache License, Version 2.0 (permissive) — Licensed under Apache License, Version 2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions.
last release 2024-06-27 (778 days) · last repo commit 2026-04-02 · 102 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 809,689 downloads/mo, #5,009 on PyPI
Alternatives
Verify before relying
pip install swagger-spec-validator
from swagger_spec_validator import validate_spec_url
# Validate a Swagger 2.0 spec from a URL
validate_spec_url('http://petstore.swagger.io/v2/swagger.json')- Whether the validator supports OpenAPI 3.0+ specifications or only Swagger 1.2 and 2.0
- Performance characteristics when validating large or complex specifications
What it is and what it does
Swagger Spec Validator is a Python library that checks Swagger API specifications for compliance with the official Swagger 1.2 or 2.0 specification. It takes a Swagger spec (typically loaded from a URL or file) and validates its structure, required fields, and data types against the specification schema. The validation catches structural errors, missing required fields, and type mismatches that would prevent the spec from being used by API tools and code generators.
The package is built on jsonschema and pyyaml to parse and validate YAML and JSON specs. It's commonly used in API development workflows to catch spec errors early, in CI/CD pipelines to gate spec changes, and by API frameworks that need to verify specs before generating client code or server stubs.
Use it for
- Validate Swagger specs in CI/CD pipelines before deploying API documentation or code generators
- Check Swagger 2.0 specs programmatically during API development to catch schema errors early
- Verify Swagger 1.2 legacy specs for compliance when migrating or maintaining older APIs
- Integrate spec validation into API tooling or frameworks that consume Swagger definitions
- Validate specs fetched from remote URLs to ensure they meet Swagger specification requirements
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is production-stable, actively maintained with recent commits, has low install friction, carries no known vulnerabilities, and solves a concrete problem in API development. Install it if you work with Swagger 1.2 or 2.0 specs and need programmatic validation.
Install
swagger-spec-validator on PyPI
Before you install
Low friction install with four lightweight runtime dependencies (jsonschema, pyyaml, typing-extensions, importlib-resources). Actively maintained with recent commits and production-stable status.
License in practice
Licensed under Apache License, Version 2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions.
Quickstart
pip install swagger-spec-validator
from swagger_spec_validator import validate_spec_url
# Validate a Swagger 2.0 spec from a URL
validate_spec_url('http://petstore.swagger.io/v2/swagger.json')
Verify before relying
- Whether the validator supports OpenAPI 3.0+ specifications or only Swagger 1.2 and 2.0
- Performance characteristics when validating large or complex specifications
Package facts
| License | Apache License, Version 2.0 permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesjsonschemapyyamltyping-extensionsimportlib-resources |
| Maintenance | Actively maintained 778 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 809,689 / month, #5,009 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Libraries :: Python Modules |
Evidence: swagger_spec_validator-3.0.4-py2.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 › “swagger spec validation”
- swagger-spec-validatorValidates Swagger/OpenAPI specifications (versions 1.2 and 2.0)…
- prancePrance parses and validates Swagger/OpenAPI 2.0 and 3.0…
- flexValidates Swagger 2.0 API specifications against JSON Schema and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also flex · prance · openapi-spec-validator · openapi3 · bravado-core · bagit-profile · openapi-schema-validator · openapi-codec · Cerberus · kubernetes-validate