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.1.0.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.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for schemax_openapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 184148c9f289844e48e8a3766246ea371ba7b86c73a2dcd22160ac730a5efe0b
MD5 308f53571e64442af8262a46054459ff
BLAKE2b-256 0e2ba6b2517414145bc203cebd755ec498090e0fcb2b5e1a76b477a3390b9a54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for schemax_openapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8e7dd305bdf87a8ffafa732e67631892ef281a344d1e6969311a119ef94b914
MD5 379ab143cf5547a31e5edd5575a1aac2
BLAKE2b-256 4f59124d22ffd09a013c15b6635bbaa741588501e0f81e628f1d6541ecf7b857

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