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

It looks like https://github.com/koxudaxi/datamodel-code-generator/pull/66 made schema type names automatically split into "modular" schemas based on `.` in the type name. The SLURM scheduler API schema has schema names per-version like...

enhancement

**Describe the bug** Generating models from a nested directory structure with relative references leads to invalid imports. For the structure shown below, the generated class for B has invalid relative...

bug

**Describe the bug** - Running dmcg with `--field-constraints` on JSON Schema with nested arrays produces incorrect output for all model types - Nested type information is lost, and replaced with...

enhancement

## Goal To provide clear and comprehensive documentation detailing the support status for various input formats like JsonSchema and OpenAPI, including different drafts like Draft 7 and Draft 2019-09, to...

documentation

**Describe the bug** There appears to be a bug when it comes to local file references; specifically for the paths section. While iterating over the `paths` object, there is a...

bug

**Describe the bug** When referencing paths from another file with json pointer encoding according to [RFC-6901](https://datatracker.ietf.org/doc/html/rfc6901#section-3) or url encoding, `Models not found in the input data `is outputted. **To Reproduce**...

enhancement

**Is your feature request related to a problem? Please describe.** I'm using pydantic to parse raw data in a dataflow pipeline. This comes with a lot of nested data models...

**Describe the bug** Doesn't generate models for [SpaceTraders](https://spacetraders.io) OpenAPI spec. **To Reproduce** ``` $ datamodel-codegen --url https://raw.githubusercontent.com/SpaceTradersAPI/api-docs/main/reference/SpaceTraders.json --output models.py The input file type was determined to be: openapi This can...

answered

**Is your feature request related to a problem? Please describe.** imagine the following json structure ```json { "a": { "a": [0,1,2], "b": 1, "c": 2, } } ``` which has...

bug

### Discussed in https://github.com/koxudaxi/datamodel-code-generator/discussions/1205 Originally posted by **michaeligreenberg** March 28, 2023 Here's an example FastAPI app: ``` from typing import Tuple from fastapi import FastAPI from pydantic import BaseModel class...