You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I have pydantic v2 model and I'd like to annotate my view using @extend_schema(response=...) that it returns the list of this pydantic model instances, something similar as you can do with DRF serializer using many=True... however I did not find a way how I can make this work correctly...
Can you please help me what is a way of doing so? I've tried TypeAdapter, List[MyModel] and some other combinations, but neither of them seems to return correct openapi schema with correctly defined refs in #/components/schemas/{model}...
Thanks a lot!
The text was updated successfully, but these errors were encountered:
Hello!
I have pydantic v2 model and I'd like to annotate my view using
@extend_schema(response=...)
that it returns the list of this pydantic model instances, something similar as you can do with DRF serializer usingmany=True
... however I did not find a way how I can make this work correctly...Can you please help me what is a way of doing so? I've tried
TypeAdapter
,List[MyModel]
and some other combinations, but neither of them seems to return correct openapi schema with correctly defined refs in#/components/schemas/{model}
...Thanks a lot!
The text was updated successfully, but these errors were encountered: