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.** msgspec support for discriminated unions is not currently supported by datamodel-code-generator and it would be great to support discriminated unions....
**Describe the bug** datamodel-codegen is unable to produce a working dataclass model for AWS CloudFormation. - ordering of output class properties does not work with default values and inheritance, suggest...
**Is your feature request related to a problem? Please describe.** We have a lot of timedelta fields in our schemas and would like to take advantage of Pydantic's native handling...
**Describe the bug** I have a schema which I think is very clearly saying 'this field is required, and takes a default.' But datamodel-codegen generates a model which accepts None...
**Describe the solution you'd like** I would like an option to be able to output 1 .py file per model, instead of having them all in the same file. Ideally...
**Describe the bug** When generating data models from schemas in a directory (owned by another team in my case), the generated file names contain invalid characters, which doesn't allow python...
**Is your feature request related to a problem? Please describe.** OpenAPI 3.0 does not natively support the full set of the JSON-Schema specification; notably, `patternProperties` and `propertyNames` are absent. Some...
The JSON Schema is here: https://www.encodeproject.org/profiles/experiment#raw I'm calling: `datamodel-codegen --input experiment.json --input-file-type jsonschema --output models/experiment.py --output-model-type pydantic_v2.BaseModel` The model is loaded perfectly by pydantic, but my specific data fails to...
**Describe the bug** I have been trying to use `datamodel-code-generator` with the following specification: https://github.com/hashintel/hash/blob/main/apps/hash-graph/openapi/openapi.json. The current workflow is that I first bundle all references using `@redocly/cli` and then pipe...
I have a YAML spec, for which datamodel-codegen was working fine until the release 0.18.0. With 0.18.0 I see some unexpected code generation when I do not specify any `--input-file-type`...