datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

Pydantic model and dataclasses.dataclass generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.

Results 379 datamodel-code-generator issues
Sort by recently updated
recently updated
newest added

**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...

enhancement

**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...

enhancement

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...

documentation

**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...

enhancement

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...

documentation

**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: ```...

enhancement
help wanted

**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...

bug