--- id: swagger-spec-validator version: "3.0.4" license: Apache License, Version 2.0 license_treatment: permissive maintenance: active --- # swagger-spec-validator — Validation of Swagger specifications License: permissive · Maintenance: active · Downloads: 809.7K/mo ## 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 above — verify before relying. Validates Swagger/OpenAPI specifications (versions 1.2 and 2.0) against their official schema to ensure full compliance with the Swagger specification. 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 pip install swagger-spec-validator uv add swagger-spec-validator poetry add swagger-spec-validator ## Installing swagger-spec-validator 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_current - Install friction: low - Maintenance: active - Downloads: 809.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags swagger spec validation, openapi validator, swagger 2.0 validator, api specification validator, swagger compliance checker, validate swagger json, swagger schema validation, api-validation, swagger-openapi [View on SkillFed](https://skillfed.io/packages/swagger-spec-validator) · [View on PyPI](https://pypi.org/project/swagger-spec-validator/)