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

### Steps to reproduce 1. Download the NVD CVE [schema][schema] 2. Generate a msgpsec model: ```sh datamodel-codegen \ --input $schema_json \ --input-file-type jsonschema \ --output-model-type 'msgspec.Struct' \ # This is...

### Steps to reproduce 1. Download the NVD CVE [schema][schema] 2. Generate a msgpsec model: ```sh datamodel-codegen \ --input $schema_json \ --input-file-type jsonschema \ --output-model-type 'msgspec.Struct' \ --snake-case-field \ --output...

**Is your feature request related to a problem? Please describe.** If I define an enum in my GraphQL schema, the generator creates the `Enum` subclass. ``` enum Status { FIRST,...

**Describe the bug** When using a JSON schema as input with aoneOf construct where one option is an array with items defined in a subschema, the resulting pydantic v2 model...

**Describe the bug** I have downloaded the latest GraphQL schema of our Shopify store with the following commands: ``` npm install -g get-graphql-schema get-graphql-schema -h 'X-Shopify-Access-Token=REDACTED' https://hat-labs.myshopify.com/admin/api/2024-04/graphql.json > shopify_schema_2024-04.graphql ```...

**Describe the bug** When using custom templates, the `field.nullable` value can be `None`, even though one is set from the provided OpenAPI spec. We only seem to pass it along...

I run the comand: ``` datamodel-codegen --url http://localhost:8000/openapi.json --output src/server/models/language_server_rpc.py --openapi-scopes schemas paths tags parameters --output-model-type pydantic.BaseModel ``` And endpoint params are named like this: `ApiV2WorkspacesWorkspaceIdMapDependenciesPostResponse` Is it possible to...

**Describe the bug** Within the OSCAL schema is: ``` "EmailAddressDatatype" : { "description" : "An email address string formatted according to RFC 6531.", "allOf" : [ { "$ref" : "#/definitions/StringDatatype"...

**Describe the bug** I have a directory of json schemas that cannot be modified. Inside this directory, there are several files with the following layout: ```json // Foo.json { "$schema":...

**Describe the bug** When using `—strict-types` and `--field-constraints` (or `--use-annotated`) together, the field constraints are not added to the Field. **To Reproduce** Example schema: ```yaml components: schemas: Timestamp: type: integer...