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 (replace 0.2.0 with the version you are installing):

pip install openapi-dto-gen-0.2.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.2.0.tar.gz (9.9 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.2.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openapi_dto_gen-0.2.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for openapi_dto_gen-0.2.0.tar.gz
Algorithm Hash digest
SHA256 704596e945b2aee1ee60f77074c8c0a4a1882ef099f1793c5b6904e05b79b7bb
MD5 14d50faa09f29c2d705350d44d238d51
BLAKE2b-256 e4ba175b445adcaf72f1e08cda4a5f0e1db1573b1cb54b0ba5b107ea5f087b65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openapi_dto_gen-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3e933dba8b8dcd3b7e2d814b5932f1bfd812e431948e0588c4faf57679f05bf
MD5 678c9a89897091191d7cb3404da0ed3e
BLAKE2b-256 7520bf304eb9282014ab378f27477129a896c18aaec42e7700af58dd52f398a7

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