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.
Fixes a bug where field descriptions in graphql schemas are not rendered in docstrings even when `--use-field-description` is set.
**Describe the bug** The current timeout for when fetching a schema from remove host can sometime be way too short and resulting in the application fails over and over. **To...
**Describe the bug** While `capitalise-enum-members` (with an `s`) works as described, the alternative spelling, `capitalize-enum-members` (with a `z`), is completely ignored when it is specified in a `pyproject.toml` file. It...
**Describe the bug** `required` fields declared in an `allof` are missing in the generated python code. If this is not a bug, please let me know if I'm doing something...
**Describe the bug** Fail to generate python code with an `array` of `$ref` from an `allof`, an `AttributeError` has been raised by the lib. If this is not a bug,...
**Describe the bug** Fail to import models with an attribute typed with an `Annotated[list[str], Field(pattern='^[a-zA-Z]+$')]` after a code generation with the option `--collapse-root-models`. If this is not a bug, please...
Black is old, slow etc. `ruff format` would be much preferred.
**Describe the bug** When generating data models from the [2020-12 JSON schema specification](https://json-schema.org/draft/2020-12/schema), all direct subclasses of `BaseModel` are missing the last letter in their class name. For example: ```python...
[OpenAPI Documents](https://spec.openapis.org/oas/latest.html#openapi-document) can have a `webhooks` root element instead of `paths` or `component`:  *https://spec.openapis.org/oas/latest.html#oasWebhooks* It usually contains path-like items with `operations` that have a `requestBody` which have content `schema`...
**Is your feature request related to a problem? Please describe.** Some schemas include a member with a common name across multiple definitions, but uniquely defined inside each one. synthetic, minimal...