All Projects → p1c2u → Openapi Core

p1c2u / Openapi Core

Licence: bsd-3-clause
OpenAPI core

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Openapi Core

Awesome Openapi3
😎 A list of awesome projects related to OpenAPI 3.0.x, curated by the community
Stars: ✭ 469 (+294.12%)
Mutual labels:  swagger, openapi, openapi3, oas, server, client
openapi-schema-validator
OpenAPI schema validator for Python
Stars: ✭ 35 (-70.59%)
Mutual labels:  schema, swagger, openapi, oas, openapi3
Openapi Spec Validator
OpenAPI Spec validator
Stars: ✭ 161 (+35.29%)
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 (+636.13%)
Mutual labels:  swagger, openapi, openapi3, oas
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+2114.29%)
Mutual labels:  swagger, openapi, openapi3, oas
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+2797.48%)
Mutual labels:  swagger, openapi, openapi3, server
Prism
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
Stars: ✭ 2,484 (+1987.39%)
Mutual labels:  swagger, openapi, openapi3, oas
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 (+17781.51%)
Mutual labels:  swagger, openapi, openapi3, oas
Swurg
Parse OpenAPI documents into Burp Suite for automating OpenAPI-based APIs security assessments (approved by PortSwigger for inclusion in their official BApp Store).
Stars: ✭ 94 (-21.01%)
Mutual labels:  swagger, openapi, openapi3
Openapi Gui
GUI / visual editor for creating and editing OpenAPI / Swagger definitions
Stars: ✭ 891 (+648.74%)
Mutual labels:  swagger, openapi, openapi3
Swagger Core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
Stars: ✭ 6,898 (+5696.64%)
Mutual labels:  swagger, openapi, openapi3
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (+598.32%)
Mutual labels:  swagger, openapi, openapi3
Oapi Codegen
Generate Go client and server boilerplate from OpenAPI 3 specifications
Stars: ✭ 806 (+577.31%)
Mutual labels:  swagger, openapi, openapi3
Kaizen Openapi Editor
Eclipse Editor for the Swagger-OpenAPI Description Language
Stars: ✭ 97 (-18.49%)
Mutual labels:  swagger, openapi, openapi3
Schemathesis
A modern API testing tool for web applications built with Open API and GraphQL specifications.
Stars: ✭ 768 (+545.38%)
Mutual labels:  swagger, openapi, openapi3
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+33167.23%)
Mutual labels:  swagger, openapi, openapi3
Kin Openapi
OpenAPI 3.0 implementation for Go (parsing, converting, validation, and more)
Stars: ✭ 776 (+552.1%)
Mutual labels:  swagger, openapi, openapi3
Widdershins
OpenAPI / Swagger, AsyncAPI & Semoasa definitions to (re)Slate compatible markdown
Stars: ✭ 856 (+619.33%)
Mutual labels:  swagger, openapi, openapi3
Rolodex
📇API Documentation Generator for Phoenix
Stars: ✭ 34 (-71.43%)
Mutual labels:  swagger, openapi, openapi3
Vue Openapi
OpenAPI viewer component for VueJS
Stars: ✭ 66 (-44.54%)
Mutual labels:  swagger, openapi, openapi3

openapi-core


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

About

Openapi-core is a Python library that adds client-side and server-side support for the OpenAPI Specification v3 <https://github.com/OAI/OpenAPI-Specification>__.

Key features


  • Validation of requests and responses
  • Schema casting and unmarshalling
  • Media type and parameters deserialization
  • Security providers (API keys, Cookie, Basic and Bearer HTTP authentications)
  • Custom deserializers and formats
  • Integration with libraries and frameworks

Documentation #############

Check documentation to see more details about the features. All documentation is in the "docs" directory and online at openapi-core.readthedocs.io <https://openapi-core.readthedocs.io>__

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

Recommended way (via pip):

::

$ pip install openapi-core

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

.. code-block:: bash

$ pip install -e git+https://github.com/p1c2u/openapi-core.git#egg=openapi_core

Usage

Firstly create your specification:

.. code-block:: python

from openapi_core import create_spec

spec = create_spec(spec_dict)

Request


Now you can use it to validate requests

.. code-block:: python

from openapi_core.validation.request.validators import RequestValidator

validator = RequestValidator(spec) result = validator.validate(request)

raise errors if request invalid

result.raise_for_errors()

get list of errors

errors = result.errors

and unmarshal request data from validation result

.. code-block:: python

get parameters object with path, query, cookies and headers parameters

validated_params = result.parameters

or specific parameters

validated_path_params = result.parameters.path

get body

validated_body = result.body

get security data

validated_security = result.security

Request object should be instance of OpenAPIRequest class (See Integrations <https://openapi-core.readthedocs.io/en/latest/integrations.html>__).

Response


You can also validate responses

.. code-block:: python

from openapi_core.validation.response.validators import ResponseValidator

validator = ResponseValidator(spec) result = validator.validate(request, response)

raise errors if response invalid

result.raise_for_errors()

get list of errors

errors = result.errors

and unmarshal response data from validation result

.. code-block:: python

get headers

validated_headers = result.headers

get data

validated_data = result.data

Response object should be instance of OpenAPIResponse class (See Integrations <https://openapi-core.readthedocs.io/en/latest/integrations.html>__).

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

  • openapi-spec-validator <https://github.com/p1c2u/openapi-spec-validator>__
  • openapi-schema-validator <https://github.com/p1c2u/openapi-schema-validator>__
  • pyramid_openapi3 <https://github.com/niteoweb/pyramid_openapi3>__
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].