Skip to main content

Generate Java DTOs from OpenAPI/Swagger components.schemas.

Project description

openapi-dto-gen

Generate Java DTOs from OpenAPI/Swagger components.schemas.

This package provides a simple command-line tool that converts the components.schemas section of an OpenAPI/Swagger file into Java data transfer objects (DTOs). It supports basic type mapping, enum generation, flattened allOf inheritance, and optional Lombok annotations.

Installation

Install via pip after downloading the distribution files:

pip install openapi-dto-gen-0.1.0-py3-none-any.whl

Usage

Run the tool from the command line to generate DTOs:

openapi-to-dto \
  --in ./openapi.yaml \
  --out ./generated-src \
  --package com.example.dto \
  --lombok
  • --in – Path to your OpenAPI YAML or JSON file.
  • --out – Output directory for the generated .java files.
  • --package – Java package name for the generated classes.
  • --lombok – (optional) Add Lombok annotations (@Data, @Builder, etc.) to the classes.

License

This project is provided under the MIT License; see the LICENSE file for details.

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

openapi_dto_gen-0.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

openapi_dto_gen-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openapi_dto_gen-0.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for openapi_dto_gen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7013586d49f38ca873129605ce87596ef09268c27e6aaa04a9805f0e06b24bde
MD5 c3c532c09fe4d67ab1d5f63c64347400
BLAKE2b-256 510877be00b620e0d1ec3af6e702510393882f7e8b337474f2b207a037993787

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openapi_dto_gen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70e0789bc9fb426eced9311175d6f84e27dbe84d91bd5ca1efc0743ee325d512
MD5 f1f2d4be0a7f66092b42bf45b45a7407
BLAKE2b-256 5cf1c0f26adc9b05c59092180ddbe429784fe752fcd03f6521d0588196f7f78f

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