Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

https://img.shields.io/docker/v/pythonopenapi/openapi-spec-validator.svg?color=%23086DD7&label=docker%20hub&sort=semver https://img.shields.io/pypi/v/openapi-spec-validator.svg https://travis-ci.org/python-openapi/openapi-spec-validator.svg?branch=master https://img.shields.io/codecov/c/github/python-openapi/openapi-spec-validator/master.svg?style=flat https://img.shields.io/pypi/pyversions/openapi-spec-validator.svg https://img.shields.io/pypi/format/openapi-spec-validator.svg https://img.shields.io/pypi/status/openapi-spec-validator.svg

About

OpenAPI Spec Validator is a CLI, pre-commit hook and python package that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger), OpenAPI 3.0 and OpenAPI 3.1 specification. The validator aims to check for full compliance with the Specification.

Documentation

Check documentation to see more details about the features. All documentation is in the “docs” directory and online at openapi-spec-validator.readthedocs.io

Installation

pip install openapi-spec-validator

Alternatively you can download the code and install from the repository:

pip install -e git+https://github.com/python-openapi/openapi-spec-validator.git#egg=openapi_spec_validator

Usage

CLI (Command Line Interface)

Straight forward way:

openapi-spec-validator openapi.yaml

pipes way:

cat openapi.yaml | openapi-spec-validator -

docker way:

docker run -v path/to/openapi.yaml:/openapi.yaml --rm pythonopenapi/openapi-spec-validator /openapi.yaml

or more pythonic way:

python -m openapi_spec_validator openapi.yaml

For more details, read about CLI (Command Line Interface).

pre-commit hook

repos:
-   repo: https://github.com/python-openapi/openapi-spec-validator
    rev: 0.8.0b1 # The version to use or 'master' for latest
    hooks:
    -   id: openapi-spec-validator

For more details, read about pre-commit hook.

Python package

from openapi_spec_validator import validate
from openapi_spec_validator.readers import read_from_filename

spec_dict, base_uri = read_from_filename('openapi.yaml')

# If no exception is raised by validate(), the spec is valid.
validate(spec_dict)

validate({'openapi': '3.1.0'})

Traceback (most recent call last):
    ...
OpenAPIValidationError: 'info' is a required property

For more details, read about Python package.

License

Copyright (c) 2017-2023, Artur Maciag, All rights reserved. Apache v2

Release files for openapi-spec-validator 0.8.0b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openapi-spec-validator 0.8.0b1
File Size Uploaded
openapi_spec_validator-0.8.0b1.tar.gz 37.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openapi-spec-validator 0.8.0b1
File Interpreter ABI Platform
openapi_spec_validator-0.8.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 76.8 kB

Release files / openapi_spec_validator-0.8.0b1.tar.gz

Download URL openapi_spec_validator-0.8.0b1.tar.gz
Size 37.1 kB
Tags Source
SHA-256 checksum
How to use checksums
084367ad26fff9101f5e6a09fdee7b31b2a0bc66e72f38560a986a7369766f57
BLAKE2b-256 checksum
How to use checksums
30f9d07c38d888e2d55852ec93e0d213e5ba7d16c915c702b38ab827f89c5919
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.

Transparency log

Release files / openapi_spec_validator-0.8.0b1-py3-none-any.whl

Download URL openapi_spec_validator-0.8.0b1-py3-none-any.whl
Size 39.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e07b10bf43125a964e828319c6104acc6fda8bd2d01eea1b717e614c2bbacc42
BLAKE2b-256 checksum
How to use checksums
8d278c49827f33e30784cfb4baaba1b362b007ccf07b3690a1b147ac5dbde692
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.

Transparency log

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

This release

0.8.0b1 This release

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

3 release files

0.3.0

3 release files

0.2.10

3 release files

0.2.9

3 release files

0.2.8

3 release files

0.2.7

3 release files

0.2.6

3 release files

0.2.5

3 release files

0.2.4

3 release files

0.2.3

3 release files

0.2.2

3 release files

0.2.1

3 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page