Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ from model import Book
response = {...}

books = [
Book.parse_obj(book_raw) for book_raw in response["getAuthorBooks"]
Book.model_validate(book_raw) for book_raw in response["getAuthorBooks"]
]
print(books)
# [Book(author=Author(books=[], id='51341cdscwef14r13', name='J. K. Rowling', typename__='Author'), id='1321dfvrt211wdw', title='Harry Potter and the Prisoner of Azkaban', typename__='Book'), Book(author=Author(books=[], id='51341cdscwef14r13', name='J. K. Rowling', typename__='Author'), id='dvsmu12e19xmqacqw9', title='Fantastic Beasts: The Crimes of Grindelwald', typename__='Book')]
Expand Down
2 changes: 1 addition & 1 deletion docs/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24658,7 +24658,7 @@ from model import Book
response = {...}

books = [
Book.parse_obj(book_raw) for book_raw in response["getAuthorBooks"]
Book.model_validate(book_raw) for book_raw in response["getAuthorBooks"]
]
print(books)
# [Book(author=Author(books=[], id='51341cdscwef14r13', name='J. K. Rowling', typename__='Author'), id='1321dfvrt211wdw', title='Harry Potter and the Prisoner of Azkaban', typename__='Book'), Book(author=Author(books=[], id='51341cdscwef14r13', name='J. K. Rowling', typename__='Author'), id='dvsmu12e19xmqacqw9', title='Fantastic Beasts: The Crimes of Grindelwald', typename__='Book')]
Expand Down
2 changes: 1 addition & 1 deletion src/datamodel_code_generator/input_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _get_origin_name(origin: type) -> str:


def _get_input_model_json_schema_class() -> type:
"""Get the InputModelJsonSchema class (lazy import to avoid Pydantic v1 issues)."""
"""Get the InputModelJsonSchema class lazily."""
from pydantic.json_schema import GenerateJsonSchema # noqa: PLC0415

class InputModelJsonSchema(GenerateJsonSchema):
Expand Down
2 changes: 1 addition & 1 deletion src/datamodel_code_generator/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def self_reference(self) -> bool:
"""Check if field references its parent model.

Result is cached after first call since parent is stable at render time.
Uses __dict__ for caching to avoid Pydantic v1 field assignment restrictions.
Uses __dict__ for caching to avoid Pydantic-managed field assignment.
"""
if "_self_reference_cache" in self.__dict__:
return self.__dict__["_self_reference_cache"]
Expand Down
Loading