All Projects → p1c2u → openapi-schema-validator

p1c2u / openapi-schema-validator

Licence: BSD-3-Clause License
OpenAPI schema validator for Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to openapi-schema-validator

Openapi Core
OpenAPI core
Stars: ✭ 119 (+240%)
Mutual labels:  schema, swagger, openapi, oas, openapi3
Openapi Spec Validator
OpenAPI Spec validator
Stars: ✭ 161 (+360%)
Mutual labels:  validation, swagger, openapi, oas, openapi3
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (+2402.86%)
Mutual labels:  swagger, openapi, oas, 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 (+91.43%)
Mutual labels:  validation, swagger, openapi, openapi3
Awesome Openapi3
😎 A list of awesome projects related to OpenAPI 3.0.x, curated by the community
Stars: ✭ 469 (+1240%)
Mutual labels:  swagger, openapi, oas, openapi3
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (+34.29%)
Mutual labels:  validation, openapi, oas, openapi3
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 (+60697.14%)
Mutual labels:  swagger, openapi, oas, openapi3
Prism
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
Stars: ✭ 2,484 (+6997.14%)
Mutual labels:  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 (+7428.57%)
Mutual labels:  swagger, openapi, oas, openapi3
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
Stars: ✭ 22 (-37.14%)
Mutual labels:  validation, swagger, openapi, openapi3
Dredd
Language-agnostic HTTP API Testing Tool
Stars: ✭ 3,770 (+10671.43%)
Mutual labels:  validation, swagger, openapi, openapi3
Openapi Psr7 Validator
It validates PSR-7 messages (HTTP request/response) against OpenAPI specifications
Stars: ✭ 168 (+380%)
Mutual labels:  validation, openapi, openapi3
thema
A CUE-based framework for portable, evolvable schema
Stars: ✭ 41 (+17.14%)
Mutual labels:  schema, openapi, openapi3
Php Openapi
Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.
Stars: ✭ 268 (+665.71%)
Mutual labels:  schema, openapi, openapi3
Jsonschema
An implementation of the JSON Schema specification for Python
Stars: ✭ 3,474 (+9825.71%)
Mutual labels:  schema, validation, openapi
Swagger2
Loading, parsing and validating requests to HTTP services based on Swagger v2.0 documents
Stars: ✭ 20 (-42.86%)
Mutual labels:  validation, swagger, openapi
Compojure Api
Sweet web apis with Compojure & Swagger
Stars: ✭ 1,056 (+2917.14%)
Mutual labels:  schema, swagger, openapi
nexmo-oas-renderer
Render your API references, Nexmo-style!
Stars: ✭ 40 (+14.29%)
Mutual labels:  openapi, openapi3, oas3
Swagger Parser
Swagger 2.0 and OpenAPI 3.0 parser/validator
Stars: ✭ 710 (+1928.57%)
Mutual labels:  validation, swagger, openapi
Martian
The HTTP abstraction library for Clojure/script, supporting Swagger, Schema, re-frame and more
Stars: ✭ 294 (+740%)
Mutual labels:  schema, swagger, openapi

openapi-schema-validator

https://travis-ci.org/p1c2u/openapi-schema-validator.svg?branch=master https://img.shields.io/codecov/c/github/p1c2u/openapi-schema-validator/master.svg?style=flat

About

Openapi-schema-validator is a Python library that validates schema against:

Installation

Recommended way (via pip):

$ pip install openapi-schema-validator

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

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

Usage

Simple usage

from openapi_schema_validator import validate

# A sample schema
schema = {
    "type": "object",
    "required": [
       "name"
    ],
    "properties": {
        "name": {
            "type": "string"
        },
        "age": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "nullable": True,
        },
        "birth-date": {
            "type": "string",
            "format": "date",
        }
    },
    "additionalProperties": False,
}

# If no exception is raised by validate(), the instance is valid.
validate({"name": "John", "age": 23}, schema)

validate({"name": "John", "city": "London"}, schema)

Traceback (most recent call last):
    ...
ValidationError: Additional properties are not allowed ('city' was unexpected)

You can also check format for primitive types

from openapi_schema_validator import oas31_format_checker

validate({"name": "John", "birth-date": "-12"}, schema, format_checker=oas31_format_checker)

Traceback (most recent call last):
    ...
ValidationError: '-12' is not a 'date'

Related projects

  • openapi-core
    Python library that adds client-side and server-side support for the OpenAPI.
  • openapi-spec-validator
    Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) and OpenAPI 3.0 specification
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].