Skip to main content

JSONSchema Spec with object-oriented paths

Project description

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

About

JSONSchema Spec with object-oriented paths

Key features

  • Traverse elements like paths

  • Access spec on demand with separate dereferencing accessor layer

Installation

$ 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

Usage

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)

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonschema-spec-0.1.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

jsonschema_spec-0.1.2-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file jsonschema-spec-0.1.2.tar.gz.

File metadata

  • Download URL: jsonschema-spec-0.1.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for jsonschema-spec-0.1.2.tar.gz
Algorithm Hash digest
SHA256 780a22d517cdc857d9714a80d8349c546945063f20853ea32ba7f85bc643ec7d
MD5 e81383402640535232642bcdd2819af7
BLAKE2b-256 3d17670f9890b25945c08e431534c4ea19cc0da74e6f6b2e16599d8262215402

See more details on using hashes here.

File details

Details for the file jsonschema_spec-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jsonschema_spec-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for jsonschema_spec-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e525177574c23ae0f55cd62382632a083a0339928f0ca846a975a4da9851cec
MD5 6e5f4217cd6cb6222adf3bf82b2fb94c
BLAKE2b-256 f0dc3c0cfed493e23bf3c7561b3041b97f90f75ffe364de5d22b9eb9cb3b42a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page