You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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:
repos:
- repo: https://github.com/python-openapi/openapi-spec-validatorrev: 0.8.0b1 # The version to use or 'master' for latesthooks:
- id: openapi-spec-validator
fromopenapi_spec_validatorimportvalidatefromopenapi_spec_validator.readersimportread_from_filenamespec_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 (mostrecentcalllast):
...
OpenAPIValidationError: 'info'isarequiredproperty
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
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.