datamodel-code-generator
datamodel-code-generator copied to clipboard
Pydantic model and dataclasses.dataclass generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
**Is your feature request related to a problem? Please describe.** There are a number of options which can be given for Config class. Need a option to define config and...
Hello, @koxudaxi Thank you for your great tool. I think, it will be useful to give users an opportunity to try your generator online. Therefore I created a simple (for...
**Is your feature request related to a problem? Please describe.** Currently if `nullable` is set to `True` in the schema definition, the generated type is an `Optional`. Though this isn't...
**Describe the bug** When I attempt to use either of the schemas in the attached zip file as `--input`, I get a traceback **To Reproduce** ```shell $ datamodel-codegen --input Parcel-Perform-PublicAPI-OAS3-v5.1.0-derefed.yaml...
Description strings are currently injected as a single line, which is troublesome for long strings. We should ideally split them across multiple lines in such cases: ```python class Cfg(BaseModel): b:...
**Describe the bug** Not sure if its a bug or intended case. I have a nested objects to which i have given a reference. When the classes are generated shouldn't...
**Describe the bug** Using the example on the website at this URL: https://koxudaxi.github.io/datamodel-code-generator/jsonschema/ ``` $ datamodel-codegen --input person.json --input-file-type auto --output model.py Traceback (most recent call last): File "c:\users\orion.ou\miniconda3\envs\dev\lib\site-packages\datamodel_code_generator\__main__.py", line...
I have been trying to generate a pydantic model. One of the schemas has a remote $ref to an api that uses Basicauth. So it keeps failing :/ It would...
The cons variants are not supported by mypy, instead one can use the Annotated form: ```python class A(BaseModel): p: constr(min_length=1) ``` Because the type here becomes constr that to the...
Currently the root key is used, but this has the side effect of elements being named as `RootItem1`, `RootItem2`, etc 👍