openapi-spec-validator 0.7.1
pip install openapi-spec-validator
Released:
OpenAPI 2.0 (aka Swagger) and OpenAPI 3 spec validator
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (Apache-2.0)
- Author: Artur Maciag
- Tags openapi, swagger, schema
- Requires: Python >=3.8.0, <4.0.0
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
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.5.5 # 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.
Related projects
- openapi-core
Python library that adds client-side and server-side support for the OpenAPI v3.0 and OpenAPI v3.1 specification.
- openapi-schema-validator
Python library that validates schema against the OpenAPI Schema Specification v3.0 and OpenAPI Schema Specification v3.1.
License
Copyright (c) 2017-2023, Artur Maciag, All rights reserved. Apache v2
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: Apache Software License (Apache-2.0)
- Author: Artur Maciag
- Tags openapi, swagger, schema
- Requires: Python >=3.8.0, <4.0.0
Classifiers
- Development Status
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openapi_spec_validator-0.7.1.tar.gz
.
File metadata
- Download URL: openapi_spec_validator-0.7.1.tar.gz
- Upload date:
- Size: 38.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8577b85a8268685da6f8aa30990b83b7960d4d1117e901d451b5d572605e5ec7 |
|
MD5 | 74a8e9841ded18b8cc30ddd70b382080 |
|
BLAKE2b-256 | 67fe21954ff978239dc29ebb313f5c87eeb4ec929b694b9667323086730998e2 |
File details
Details for the file openapi_spec_validator-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: openapi_spec_validator-0.7.1-py3-none-any.whl
- Upload date:
- Size: 39.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/6.2.0-1012-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c81825043f24ccbcd2f4b149b11e8231abce5ba84f37065e14ec947d8f4e959 |
|
MD5 | b4f36aeb83b00178cc30dc4061158b00 |
|
BLAKE2b-256 | 2b4de744fff95aaf3aeafc968d5ba7297c8cda0d1ecb8e3acd21b25adae4d835 |