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

**Is your feature request related to a problem? Please describe.** I'm struggling to write a schema file to use as input to `datamodel-codegen` that "combines" multiple schema files using `$ref`s....

enhancement

When using allOf that one of the options contains $ref with enum, the pydantic model is generated without the ref Example schema: ```yaml components: schemas: AdminUser: type: object properties: userType:...

**Describe the bug** When i generate my models as dataclass the generater does not consider string formats like uuid, date ... The output is just of type string which is...

enhancement
documentation

**Describe the bug** Given the following OpenAPI yaml: ``` openapi: 3.0.0 components: schemas: InventoryItem: type: object properties: item-id: type: string external-ids: type: array items: type: string oneOf: - required: [...

**Describe the bug** I have a schema defined across two files, `main.schema.json` and `dummy.schema.json`. I want to generate a Python module called `autogen`, structured like so: ``` autogen/ ├── __init__.py

bug

**Is your feature request related to a problem? Please describe.** When I have a type discriminator with a mapping where the field for the mapping is an enum, I'd like...

enhancement

**Describe the bug** When Pydantic V2 models are generated from an OpenAPI spec with discriminators, the generated Python code will have discriminators with original OpenAPI property names instead of the...

bug

**Describe the bug** A model that defines a string enum with 3 options `YES/NO/NOT_APPLICABLE` is turned into a `bool` enum with one string option. **To Reproduce** Example schema: ```yaml openapi:...

answered

**Describe the bug** According to [this OpenAPI guide](https://swagger.io/docs/specification/data-models/dictionaries/), there are two ways to define free-form objects (a.k.a., a dictionary with values of any type). They are equivalent and we expect...

bug

with version 0.25.1 having a schema like ``` RCloneConfig: type: object description: Dictionary of rclone key:value pairs (based on schema from '/storage_schema') properties: type: type: string required: - type additionalProperties:...

enhancement