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

I have a jsonschema ``` json { "title": "resource", "type": "object", "allOf": [ { "$ref": "#/$defs/PartialResource" } ], "$defs": { "PartialResource": { "title": "partial_resource", "properties": { "spec": { "title": "spec",...

enhancement
help wanted

The package currently uses several deprecated Pydantic v2 methods that should be updated to their new equivalents: 1. `parse_obj` -> `model_validate` 2. `dict` -> `model_dump` 3. `__fields_set__` -> `model_fields_set` These...

enhancement
help wanted
answered

Hello! Thanks for this awesome project! I was wondering what would be the path to generate a new ouput format, which would be made of valid Django models (using Django's...

enhancement
help wanted

**Is your feature request related to a problem? Please describe.** 1. I wrote a valid JSON Schema with many properties 2. Some properties' pattern make use of look-ahead and look-behind,...

bug
help wanted

Profiling shows a really a really long execution time of the `_get_unique_name` method from class `ModelResolver` ![Image](https://github.com/user-attachments/assets/8769ef02-e64f-4181-84b7-bad60213c58f) **To Reproduce** Example schema: We use a large swagger file created on the...

enhancement
help wanted

Following issue https://github.com/python/cpython/issues/118418 is no longer recommended to wrap pydantic definitions behind future annotations here https://github.com/argoproj-labs/hera/blob/main/src/hera/events/models/io/argoproj/workflow/v1alpha1.py#L4. This now raises a deprecation warning. Initially reported at https://github.com/argoproj-labs/hera/issues/1308#issuecomment-2619323331

enhancement
help wanted

**Is your feature request related to a problem? Please describe.** At my work, we have a few custom pydantic models that aren't really easy or possible to encode in an...

enhancement
help wanted

**Describe the bug** When a JSON schema field is declared as `"type": "array"` with no further details, the generated data model code fails typechecking: ``` src/_models/__init__.py:1990: error: Missing type parameters...

**Describe the bug** When generating Pydantic models from a jsonschema, the type [`uri`](https://spec.openapis.org/registry/format/uri) is mapped to `AnyUrl`, which is incorrect as URL is a subset of URI. A URI string...