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.
Hi, I would like to add endpoint name to Python generated scripts, the endpoint name should be probably in some variable/constant. What I mean in definitions language: ```yaml openapi: "3.0.0"...
**Describe the bug** When converting JsonSchema, if a field is defined as not required and with a null type, the converter creates a default None value for this field **To...
**Describe the bug** Refer to this answer on Pydantic's issue by PrettyWood, https://github.com/samuelcolvin/pydantic/issues/2278#issuecomment-764610380 **To Reproduce** Example schema: ```yaml Pet: type: object properties: name: type: string pet_type: $ref: "#/components/schemas/PetType" PetType: type:...
The class Model "Docentes" isn't generated by datamodel-codegen **To Reproduce** Example schema: [PastBin JsonSchme](https://pastebin.com/f1LTumYM) Used commandline: ``` datamodel-codegen --input test.json --input-file-type jsonschema --output model.py ``` **Expected behavior** Convert the "Docentes"...
> :warning: This PR isn't done yet. I'm creating it to get some feedback and help. ## Definition of Done Add support for differentiating between "nullable" and "not-required" properties. For...
**Describe the bug** - I am trying to auto-generate schema models using datamodel-codegen on an openapi documentation:- https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/dsp/3-1/openapi.yaml - The generated schema models has duplicate fields with incorrect typehints. **To...
**Is your feature request related to a problem? Please describe.** OpenAPI allows you to set a `readOnly` & `writeOnly` for fields to be able to reuse schemas for get and...
**Is your feature request related to a problem? Please describe.** I recently found [pendulum](https://pendulum.eustace.io/) and started using it as my default date and datetime management library since the standard python...
**Is your feature request related to a problem? Please describe.** From [TypeSchema website](https://typeschema.org/): > TypeSchema is a JSON format to describe data models in a language neutral format. A TypeSchema...
**Is your feature request related to a problem? Please describe.** Sometimes there is a need to have some way of representing money. JSON Schema offers `multipleOfPrecision` which could be used...