Skip to content
Draft
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
3 changes: 1 addition & 2 deletions litestar/_openapi/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ def get_reference_for_field_definition(self, field: FieldDefinition) -> Referenc
key = _get_normalized_schema_key(field)
if key not in self._schema_key_map:
return None

if (existing_type := self._component_type_map[key]) != field:
if (existing_type := self._component_type_map[key]) != field and f"{field.raw!r}" != f"{existing_type.raw!r}":
# TODO: This should check for strict equality, e.g. changes in type metadata
# However, this is currently not possible to do without breaking things, as
# we allow to define metadata on a type annotation in one place to be used
Expand Down
2 changes: 1 addition & 1 deletion litestar/dto/_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def create_transfer_model_type(
Returns:
A ``BackendT`` class.
"""
struct_name = self._create_transfer_model_name(model_name)
struct_name = self.dto_factory.__schema_name__ or self._create_transfer_model_name(model_name)

struct = _create_struct_for_field_definitions(
model_name=struct_name,
Expand Down
1 change: 1 addition & 0 deletions litestar/dto/base_dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class AbstractDTO(Generic[T]):
"""If ``annotation`` is an iterable, this is the inner type, otherwise will be the same as ``annotation``."""

_dto_backends: ClassVar[dict[str, _BackendDict]] = {}
__schema_name__: ClassVar[None | str] = None

def __init__(self, asgi_connection: ASGIConnection) -> None:
"""Create an AbstractDTOFactory type.
Expand Down
Loading