Skip to main content

Useful OpenAPI parser for d42 universe

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

OpenAPI Parser

Useful for d42 universe and schemax lib.

Installation

python3 -m pip install schemax-openapi

Usage

import yaml
import schemax_openapi
from schemax_openapi import SchemaData

from typing import List

# Also could be JSON OpenAPI file
with open('my_openapi.yaml') as schema_file:
    raw_schema = yaml.load(schema_file, yaml.FullLoader)
    
    parsed_data: List[SchemaData] = schemax_openapi.collect_schema_data(raw_schema)
    for item in parsed_data:
        print(item.path)
        print(item.response_schema_d42)
        ...

All the data is stored in SchemaData object, which has the following fields:

  • http_method: HTTP method of the request.
  • path: URL path of the request.
  • converted_path: URL path converted to the camel-case for usage in schemax generation.
  • args: Arguments of the request.
  • queries: Query parameters of the request. Currently unsupported and always empty list: [].
  • interface_method: Interface name for usage in schemax generation.
  • interface_method_humanized: Interface 'humanized' name for usage in schemax generation.
  • schema_prefix: Schema prefix name for usage in schemax generation.
  • schema_prefix_humanized: Schema prefix 'humanized' name for user in schemax generation.
  • response_schema: Normalized response schema (without $ref).
  • response_schema_d42: Converted to d42 response_schema.
  • request_schema: Normalized request schema (without $ref).
  • request_schema_d42: Converted to d42 request_schema.
  • tags: Tags of the request from OpenAPI schema.

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

schemax_openapi-0.0.6.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

schemax_openapi-0.0.6-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file schemax_openapi-0.0.6.tar.gz.

File metadata

  • Download URL: schemax_openapi-0.0.6.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for schemax_openapi-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1d0adbf00e99e3903ef0082cb1d56f220e2b045b102412a779c67bf6416d1458
MD5 1d2442e65fa5578f1742b5998d9b35fb
BLAKE2b-256 f012d61f3bd74c1dae145139b7178e4a4c7eb44975dc6cc9b9948686c4330434

See more details on using hashes here.

File details

Details for the file schemax_openapi-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for schemax_openapi-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 384a460b1db6089b9de18b27d33e4791abdd9137bd6ff5023f0c76899d33eb81
MD5 43ce1c41269db9e30ee989c52d6e7729
BLAKE2b-256 16f4b916b0f94a69038041bd218d288922c477faa919d48ea50036171d47586b

See more details on using hashes here.

Supported by

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