drf-pydantic icon indicating copy to clipboard operation
drf-pydantic copied to clipboard

<type> is not a supported composite type.

Open MrMika96 opened this issue 9 months ago • 1 comments

Hello, i have encountered some strange behavior while trying to use .drf_serializer() method. I have BaseModel what looks like this

class ExampleDTO(BaseModel):
    field_1: Optional[Annotated[int, Field(description="Field1")]] = None
    field_2: Optional[Annotated[int, Field(description="Field2")]] = None
    field_3: Optional[Annotated[str, Field(description="Field3")]] = None

and this return me next error message:

drf_pydantic.errors.ModelConversionError: Error when converting model: ExampleDTO
field_1
     int is not a supported composite type.
field_2
     int is not a supported composite type.
field_3
     str is not a supported composite type.

Can you please suggest some solution?

MrMika96 avatar May 17 '24 08:05 MrMika96