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.
**Is your feature request related to a problem? Please describe.** Use extra field in the generated pydantic datamodel, that will not raise an error that extra fields are not permitted....
**Describe the bug** If a string is referenced, it is turned into a separate class that wraps the string. **To Reproduce** Given this schema: ```json { "openapi" : "3.0.0", "components"...
Fix for #810 due to deep copy introduction in Pydantic. It seems like pydantic 1.9.1 added deepcopy to model validation: ``` Config.copy_on_model_validation does a deep copy and not a shallow...
**Describe the bug** Trying to create code from an OpenAPI spec fails with a RecursionError. **To Reproduce** Example schema: https://developer.here.com/documentation/routing-api/swagger/v8.yaml Used commandline: ``` $ datamodel-codegen --url https://developer.here.com/documentation/routing-api/swagger/v8.yaml --input-file-type openapi --output...
Hello! Datamodel-codegen is a great utility. But i need so much double quotes in generated code because I use datamodel-codegen without --output option (due to the specifics of my task,...
**Is your feature request related to a problem? Please describe.** Strings in the generated models are single-quoted, which is incompatible with **black** formatter. **Describe the solution you'd like** Double quotes...
**Describe the bug** I expected to be able to generate Pydanic models for validating JSONSchemas themselves. **To Reproduce** Fetch the json-schema meta-schema draft 7: ``` wget http://json-schema.org/draft-07/schema ``` Run datamodel-codegen:...
Bumps [attrs](https://github.com/python-attrs/attrs) from 21.4.0 to 22.1.0. Release notes Sourced from attrs's releases. 22.1.0 Highlights The main features of this release are: The departure of Python 2.7 (enjoy your retirement!), and...
#805 Use BaseModel smart_union option for ConstrainsBase in order to avoid erroneous casts Add related unit tests
**Describe the bug** A field is annotated with `Optional` even though it is a required field in the OpenAPI schema. **To Reproduce** Example schema: ```yaml openapi: 3.0.0 info: title: "no...