No project description provided
Project description
OpenAPI Spec validator
About
OpenAPI Spec Validator is a Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0.0 specification. The validator aims to check for full compliance with the Specification.
Installation
$ pip install openapi-spec-validator
Usage
Command Line Interface
Straight forward way:
$ openapi-spec-validator some.yaml
or more pythonic way:
$ python -m openapi_spec_validator some.yaml
Examples
Validate spec:
from openapi_spec_validator import validate_spec
validate_spec(spec_dict)
Add spec_url
to validate spec with relative files:
from openapi_spec_validator import validate_spec
validate_spec(spec_dict, spec_url='file:///path/to/spec/openapi.yaml')
You can also validate spec from url:
from openapi_spec_validator import validate_spec_url
validate_spec_url('http://example.com/openapi.json')
If you want to iterate through validation errors:
from openapi_spec_validator import openapi_v3_spec_validator
errors_iterator = openapi_v3_spec_validator.iter_errors(spec)
Related projects
- openapi-core is a Python library that adds client-side and server-side support for the OpenAPI.
License
Copyright (c) 2017, Artur Maciag, All rights reserved. Apache v2
Project details
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 Distributions
Close
Hashes for openapi-spec-validator-0.2.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6788b2f9ceeb87293cd5fda266227be9c3fe541c23328e0c3d31413ad5c3dfc7 |
|
MD5 | 80b4db427d04dae6ad851db2b12012f4 |
|
BLAKE2b-256 | 7544d14f68c216be327c1114306c3ddb65d489896344c96f0bcbb770482e5366 |
Close
Hashes for openapi_spec_validator-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdc90d33fbf7ab9ef9c4bee27cdbf017aaedd4302b9335ce32f2aa05be56a68a |
|
MD5 | 1a14db1a40d2ea72d73f867f3f2cea53 |
|
BLAKE2b-256 | 3b252578ef159bf090b28ca311cbbb14010a3d44dfe1bcf175e233bd2b2c995b |
Close
Hashes for openapi_spec_validator-0.2.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 941b54012c48090d5459fe091ab26f55d3acd548c7acd5cd7be9e5580712523b |
|
MD5 | 74235a02fb797fa4516360367c8cd2e5 |
|
BLAKE2b-256 | 55bd1ed906001528405313acf587ae474a02f555d43ec89809bd2a0f86396bdb |