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.javafiles.--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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7013586d49f38ca873129605ce87596ef09268c27e6aaa04a9805f0e06b24bde
|
|
| MD5 |
c3c532c09fe4d67ab1d5f63c64347400
|
|
| BLAKE2b-256 |
510877be00b620e0d1ec3af6e702510393882f7e8b337474f2b207a037993787
|
File details
Details for the file openapi_dto_gen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openapi_dto_gen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70e0789bc9fb426eced9311175d6f84e27dbe84d91bd5ca1efc0743ee325d512
|
|
| MD5 |
f1f2d4be0a7f66092b42bf45b45a7407
|
|
| BLAKE2b-256 |
5cf1c0f26adc9b05c59092180ddbe429784fe752fcd03f6521d0588196f7f78f
|