All Projects → p1c2u → Openapi Spec Validator

p1c2u / Openapi Spec Validator

Licence: apache-2.0
OpenAPI Spec validator

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Openapi Spec Validator

openapi-schema-validator
OpenAPI schema validator for Python
Stars: ✭ 35 (-78.26%)
Mutual labels:  validation, swagger, openapi, oas, openapi3
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+1536.65%)
Mutual labels:  swagger, openapi, openapi3, oas
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
Stars: ✭ 22 (-86.34%)
Mutual labels:  validation, swagger, openapi, openapi3
Openapi Spring Webflux Validator
🌱 A friendly kotlin library to validate API endpoints using an OpenApi 3.0 and Swagger 2.0 specification
Stars: ✭ 67 (-58.39%)
Mutual labels:  swagger, openapi, openapi3, validation
Openapi Core
OpenAPI core
Stars: ✭ 119 (-26.09%)
Mutual labels:  swagger, openapi, openapi3, oas
Prism
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
Stars: ✭ 2,484 (+1442.86%)
Mutual labels:  swagger, openapi, openapi3, oas
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-70.81%)
Mutual labels:  validation, openapi, oas, openapi3
Dredd
Language-agnostic HTTP API Testing Tool
Stars: ✭ 3,770 (+2241.61%)
Mutual labels:  swagger, openapi, openapi3, validation
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+13116.77%)
Mutual labels:  swagger, openapi, openapi3, oas
Awesome Openapi3
😎 A list of awesome projects related to OpenAPI 3.0.x, curated by the community
Stars: ✭ 469 (+191.3%)
Mutual labels:  swagger, openapi, openapi3, oas
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (+444.1%)
Mutual labels:  swagger, openapi, openapi3, oas
Rolodex
📇API Documentation Generator for Phoenix
Stars: ✭ 34 (-78.88%)
Mutual labels:  swagger, openapi, openapi3
Oooas
An object oriented approach to generating OpenAPI specs, implemented in PHP.
Stars: ✭ 162 (+0.62%)
Mutual labels:  swagger, openapi, oas
Restful React
A consistent, declarative way of interacting with RESTful backends, featuring code-generation from Swagger and OpenAPI specs 🔥
Stars: ✭ 1,814 (+1026.71%)
Mutual labels:  swagger, openapi, openapi3
Rapipdf
PDF generation from OpenAPI / Swagger Spec
Stars: ✭ 132 (-18.01%)
Mutual labels:  swagger, openapi, openapi3
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+24488.82%)
Mutual labels:  swagger, openapi, openapi3
Springdoc Openapi
Library for OpenAPI 3 with spring-boot
Stars: ✭ 1,113 (+591.3%)
Mutual labels:  swagger, openapi, openapi3
Vue Openapi
OpenAPI viewer component for VueJS
Stars: ✭ 66 (-59.01%)
Mutual labels:  swagger, openapi, openapi3
Swagger2
Loading, parsing and validating requests to HTTP services based on Swagger v2.0 documents
Stars: ✭ 20 (-87.58%)
Mutual labels:  swagger, openapi, validation
Express Jsdoc Swagger
Swagger OpenAPI 3.x generator
Stars: ✭ 69 (-57.14%)
Mutual labels:  swagger, openapi, openapi3

OpenAPI Spec validator


.. image:: https://img.shields.io/pypi/v/openapi-spec-validator.svg :target: https://pypi.python.org/pypi/openapi-spec-validator .. image:: https://travis-ci.org/p1c2u/openapi-spec-validator.svg?branch=master :target: https://travis-ci.org/p1c2u/openapi-spec-validator .. image:: https://img.shields.io/codecov/c/github/p1c2u/openapi-spec-validator/master.svg?style=flat :target: https://codecov.io/github/p1c2u/openapi-spec-validator?branch=master .. image:: https://img.shields.io/pypi/pyversions/openapi-spec-validator.svg :target: https://pypi.python.org/pypi/openapi-spec-validator .. image:: https://img.shields.io/pypi/format/openapi-spec-validator.svg :target: https://pypi.python.org/pypi/openapi-spec-validator .. image:: https://img.shields.io/pypi/status/openapi-spec-validator.svg :target: https://pypi.python.org/pypi/openapi-spec-validator

About

OpenAPI Spec Validator is a Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md>__ and OpenAPI 3.0 <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md>__ specification. The validator aims to check for full compliance with the Specification.

Installation ############

::

$ pip install openapi-spec-validator

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

.. code-block:: bash

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

Usage

Command Line Interface


Straight forward way:

.. code:: bash

$ openapi-spec-validator openapi.yaml

pipes way:

.. code:: bash

$ cat openapi.yaml | openapi-spec-validator -

docker way:

.. code:: bash

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

or more pythonic way:

.. code:: bash

$ python -m openapi_spec_validator openapi.yaml

Examples


Validate spec:

.. code:: python

from openapi_spec_validator import validate_spec
from openapi_spec_validator.readers import read_from_filename

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

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

validate_spec({})

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

Add spec_url to validate spec with relative files:

.. code:: python

validate_spec(spec_dict, spec_url='file:///path/to/spec/openapi.yaml')

You can also validate spec from url:

.. code:: python

from openapi_spec_validator import validate_spec_url

# If no exception is raised by validate_spec_url(), the spec is valid.
validate_spec_url('http://example.com/openapi.json')

If you want to iterate through validation errors:

.. code:: python

from openapi_spec_validator import openapi_v3_spec_validator

errors_iterator = openapi_v3_spec_validator.iter_errors(spec)

Related projects ################

  • openapi-core <https://github.com/p1c2u/openapi-core>__ Python library that adds client-side and server-side support for the OpenAPI.
  • openapi-schema-validator <https://github.com/p1c2u/openapi-schema-validator>__ Python library that validates schema against the OpenAPI Schema Specification v3.0.

License #######

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].