Created
October 29, 2023 18:22
-
-
Save serjflint/4a2aba8c6484232ab0b96c900bfafe27 to your computer and use it in GitHub Desktop.
datamodel-code-generator params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python3.11 -m datamodel_code_generator --input=path/to/openapi.json \ | |
--input-file-type=openapi --output-model-type=pydantic_v2.BaseModel \ | |
--output=path/to/genearated.py \ | |
--use-annotated --strict-nullable --use-standard-collections \ | |
--use-generic-container-types --use-union-operator \ | |
--use-schema-description --use-field-description \ | |
--reuse-model --use-operation-id-as-name \ | |
--target-python-version=3.11 --validation --openapi-scopes paths schemas parameters \ | |
--enum-field-as-literal all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment