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.
**Describe the bug** I have used `datamodel-code-generator` with a custom mapping to create a Pydantic v2 model. Doing that resulted in [field names having the same name as other models](https://github.com/pydantic/pydantic/issues/7871)...
I am using `datamodel-code-generator` to generate models to go along with `Uplink` to create REST clients. My REST API documentation is in OpenAPI yaml format and includes examples for field...
**Describe the bug** When generating models from the openapi specification and when the names of the schemas contain dots, incorrect imports are generated inside __init__.py for modules that are actually...
When generating schemas with a directory of JSON-Schemas as `--input` the relative import paths will be problematic. I had a complex use-case where pydantic threw an error when attempting to...
**Describe the bug** The python target version argument seems to have no effect on using more modern typing from python For example, targeting 3.11 will still give type that are...
**Describe the bug** When working with a jsonschema and invoking the model generator, one encounters following error: `Modular references require an output directory, not a file` It appears that the...
Okay, this is obviously a really minor one, but I _did_ just get caught out by it. 🙂 **Describe the bug** When running `datamodel-codegen --help` (or reading the README), the...
I have a really bizarre issue where the string 'NO' (ISO country code for Norway - we need this literal string to be an enum value), as part of an...
**Describe the bug** When working with Set collection, It is not possible to perform add operations on the set collection due to missing hash function. One gets following error: ```...
**Describe the bug** When working with enum type whose values are objects, the field names of the objects are not populated correctly. It generates something like: `array___title____usa____type____object____properties_____usa_____title____usa____type____object____properties________required________additional_properties___false_____additional_properties___false_` **To Reproduce** Generated...