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.
**Describe the bug** Thank you for your work on this tool. I am working on converting an openapi specification. However, I get an error saying that `FileNotFoundError: [Errno 2] No...
My PR #2417 was incomplete: the `--extra-fields` option was not respected in pydantic v2 models. For example, given the schema ```json { "title": "Test", "type": "object", "required": [ "foo" ],...
my datamodel-code-generator version is: 0.31.0 my json: ```json { "code": 0, "message": "success", "data": { "user_id": 12345, "username": "test_user", "email": "[email protected]", "permissions": ["read", "write", "delete"], "profile": {"level": 5, "score": 85,...
### What is in this change? This PR attempts to fix a bug in the codegen for graphql inputs when `--use-default-kwarg` is true. Specifically the `typename__` field does not comply....
Solves Issues https://github.com/koxudaxi/datamodel-code-generator/issues/1955#issue-2290971596 and https://github.com/koxudaxi/datamodel-code-generator/issues/1952#issue-2287818185 It boils down to yaml vs. json floating point parsing. The SafeLoader of yaml has to be extended to allow for the same range of...
**Is your feature request related to a problem? Please describe.** > [!NOTE] > This is a nice-to-have more than something that fixes a problem. Currently, if you want to override...
First off, thanks for making an awesome and easy to use tool! **Describe the bug** I use this tool to generate pydantic v2 models from graphql code. I am using...
**Is your feature request related to a problem? Please describe.** When a model has a "oneOf" requirement, Datamodel creates multiple models, with each field required, and then creates a "root"...
**Describe the bug** As part of a much bigger API where I needed to use "allOf" to construct a schema in a DRY way I encountered the following problem: When...
I'm currently generating a series of `msgspec.Structs` from previously generated JSON schemas that originate from custom written `pydantic` models. An example of such models is the following: ```py from typing...