msgspec_dto#

class litestar.dto.msgspec_dto.MsgspecDTO#

Bases: AbstractDTO, Generic[T]

Support for domain modelling with Msgspec.

classmethod generate_field_definitions(model_type: type[Struct]) Generator[DTOFieldDefinition, None, None]#

Generate FieldDefinition instances from model_type.

Yields:

FieldDefinition instances.

classmethod detect_nested_field(field_definition: FieldDefinition) bool#

Return True if field_definition represents a nested model field.

Parameters:

field_definition – inspect type to determine if field represents a nested model.

Returns:

True if field_definition represents a nested model field.