Skip to main content

Data Transfer Object (DTO) codegen from JSON schemas following the OpenAPI spec

Project description

godto

Data Transfer Object (DTO) codegen from JSON schemas following the OpenAPI spec

Usage

To work with an OpenAPI schema, load it with the Model class, which is a Dataclass Wizard deserialiser.

from godto.openapi.v3 import Model

model = Model.from_json(schema_json)

For example the Transport for London StopPoint API schema is shipped as package data in tubeulator.

from pathlib import Path

path_to_schema = Path("data/openapi/StopPoint/StopPoint.json")
schema_json = path_to_schema.read_text()

Requirements

Python 3.9 or 3.10

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

godto-0.0.3.tar.gz (16.3 kB view hashes)

Uploaded Source

Built Distribution

godto-0.0.3-py3-none-any.whl (16.7 kB view hashes)

Uploaded Python 3

Supported by

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