JSONSchema Spec with object-oriented paths
- Traverse elements like paths
- Access spec on demand with separate dereferencing accessor layer
$ pip install jsonschema-spec
Alternatively you can download the code and install from the repository:
$ pip install -e git+https://github.com/p1c2u/jsonschema-spec.git#egg=jsonschema_spec
from jsonschema_spec import Spec
d = {
"openapi": "3.0.1",
"info": {
"$ref": "#/components/Version",
},
"paths": {},
"components": {
"Version": {
"title": "Minimal",
"version": "1.0",
},
},
}
spec = Spec.from_dict(d)
# Concatenate paths with /
info = spec / "info"
# Stat path keys
"title" in info
# Open path dict
with info.open() as info_dict:
print(info_dict)
- 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
- openapi-schema-validator
- Python library that validates schema against the OpenAPI Schema Specification v3.0.
Copyright (c) 2017-2022, Artur Maciag, All rights reserved. Apache v2