-
-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support InputFileType.Json and InputFileType.Dict (#2165)
* feat: support InputFileType.Json and InputFileType.Dict * fix: support Mapping as input_ of generate() * chore: use read_text for InputFileType.Json for consistency * fix: fixed failing test cases * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: incorrect handling of direct dict input * test: add test for direct dict input * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: remove dead code * Add else pattern --------- Co-authored-by: Koudai Aono <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: XieJiSS <[email protected]>
- Loading branch information
1 parent
7782e51
commit b8a27e7
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# generated by datamodel-codegen: | ||
# filename: <dict> | ||
# timestamp: 2024-12-14T00:00:00+00:00 | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class Bar(BaseModel): | ||
baz: int | ||
|
||
|
||
class Model(BaseModel): | ||
foo: int | ||
bar: Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters