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.
Closes #1910 Tested against the cases described in #1910, both are now generating the expected Python classes, and replacing `List[Any]` with a list of the expected class.
Update the ordering of the actions as the one literal on default option is not working for descriminator properties
Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.25.3 to 20.26.2. Release notes Sourced from virtualenv's releases. 20.26.0 What's Changed release 20.25.3 by @gaborbernat in pypa/virtualenv#2704 Fixed a case when template variable is WindowsPath by...
Bumps [freezegun](https://github.com/spulec/freezegun) from 1.4.0 to 1.5.1. Changelog Sourced from freezegun's changelog. 1.5.1 Fix the typing of the tick() method, and improve it's behaviour. 1.5.0 The default ignore list now contains...
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...
**Describe the bug** Bug in parsing `number` in scientific notation **To Reproduce** Example schema: ```json { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "test": { "type": "number", "title": "Test", "description": "Testcase",...
If you try to use `--custom-template-dir` along with `--reuse-model`, The reused model is not using the same template as the original. The initializer is missing the template dir on construction.
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.1 to 0.4.4. Release notes Sourced from ruff's releases. v0.4.4 Changes Preview features [pycodestyle] Ignore end-of-line comments when determining blank line rules (#11342) [pylint] Detect pathlib.Path.open calls...
**Describe the bug** Scientific notation in json converts to str in model: ```python class Model(BaseModel): hello: str ``` **To Reproduce** Example json: ```json { "hello": 1e-9 } ``` Used commandline:...
**Describe the bug** When we use schema $def tag and define the subschemas separately if the first field in the object has a const value, the value is not detected...