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

This would resolve #1683. This PR is just a suggestion. I monkey-patched the function in my code this way to get my use-case to work so I wanted to share...

1. Added a new formatter module (now is not using in main code). Example: ```python from datamodel_code_generator.formatter.base import BaseCodeFormatter class CustomHeaderCodeFormatter(BaseCodeFormatter): formatter_name: ClassVar[str] = "custom" def __init__(self, formatter_kwargs: Dict[str, Any])...

**Is your feature request related to a problem? Please describe.** Let's start with an example how other people use this. If you will take a look at https://github.com/koxudaxi/datamodel-code-generator/blob/master/poetry.lock#L1 you will...

help wanted

Also removed old python 3.6 code, and increased the upper bound of some deps

[ruff](https://github.com/astral-sh/ruff) supports `format` command. We should add the feature to select `ruff` as formatter in code generation instead of `black`.

enhancement

I have the following OpenAPI spec which does not appear to work in terms of generating an `Optional` field: ``` components: Foo: type: object nullable: true properties: bar: type: string...

## Is your feature request related to a problem? Please describe. When generating models from JSON Schema it would be nice to be able to generate `Tuple[]` types using [Tuple...

enhancement

**Is your feature request related to a problem? Please describe.** Currently, when the parser finds two properties with the same name, it appends the number at the end to prevent...

**Describe the bug** When feeding a schema with a subschema with an `$id` field, and then referencing that subschema by its full or relative id, datamodel-codegen tries to download said...

**Is your feature request related to a problem? Please describe.** When parsing a jsonschema, if jsonschema title contains underscore, a pydantic class name will be created without underscore (it will...