Skip to main content

OpenAPI Spec validator

Package Version Build Status Code Coverage PyPI Version PyPI Format PyPI Status

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openapi-spec-validator-0.2.5.tar.gz (22.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

openapi_spec_validator-0.2.5-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

openapi_spec_validator-0.2.5-py2-none-any.whl (24.9 kB view details)

Uploaded Python 2

File details

Details for the file openapi-spec-validator-0.2.5.tar.gz.

File metadata

  • Download URL: openapi-spec-validator-0.2.5.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for openapi-spec-validator-0.2.5.tar.gz
Algorithm Hash digest
SHA256 6788b2f9ceeb87293cd5fda266227be9c3fe541c23328e0c3d31413ad5c3dfc7
MD5 80b4db427d04dae6ad851db2b12012f4
BLAKE2b-256 7544d14f68c216be327c1114306c3ddb65d489896344c96f0bcbb770482e5366

See more details on using hashes here.

File details

Details for the file openapi_spec_validator-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: openapi_spec_validator-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for openapi_spec_validator-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cdc90d33fbf7ab9ef9c4bee27cdbf017aaedd4302b9335ce32f2aa05be56a68a
MD5 1a14db1a40d2ea72d73f867f3f2cea53
BLAKE2b-256 3b252578ef159bf090b28ca311cbbb14010a3d44dfe1bcf175e233bd2b2c995b

See more details on using hashes here.

File details

Details for the file openapi_spec_validator-0.2.5-py2-none-any.whl.

File metadata

  • Download URL: openapi_spec_validator-0.2.5-py2-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10

File hashes

Hashes for openapi_spec_validator-0.2.5-py2-none-any.whl
Algorithm Hash digest
SHA256 941b54012c48090d5459fe091ab26f55d3acd548c7acd5cd7be9e5580712523b
MD5 74235a02fb797fa4516360367c8cd2e5
BLAKE2b-256 55bd1ed906001528405313acf587ae474a02f555d43ec89809bd2a0f86396bdb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

3 files

0.3.0

3 files

0.2.10

3 files

0.2.9

3 files

0.2.8

3 files

0.2.7

3 files

0.2.6

3 files

This release

0.2.5 This release

3 files

0.2.4

3 files

0.2.3

3 files

0.2.2

3 files

0.2.1

3 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

1 file

0.0.3

1 file

0.0.2

1 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