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
The error is as if we simply didn't supply the right object back... which kind of is true, but django-ninja is also supposed to understand the status code tuple?
4 validation errors for NinjaResponseSchema
response.items.0.title
Field required [type=missing, input_value=<DjangoGetter: 200>, input_type=DjangoGetter]
For further information visit https://errors.pydantic.dev/2.6/v/missing
response.items.0.country
Field required [type=missing, input_value=<DjangoGetter: 200>, input_type=DjangoGetter]
For further information visit https://errors.pydantic.dev/2.6/v/missing
response.items.1.title
Field required [type=missing, input_value=<DjangoGetter: <Organizat...zation: Clark-Fisher>]>>, input_type=DjangoGetter]
For further information visit https://errors.pydantic.dev/2.6/v/missing
response.items.1.country
Field required [type=missing, input_value=<DjangoGetter: <Organizat...zation: Clark-Fisher>]>>, input_type=DjangoGetter]
For further information visit https://errors.pydantic.dev/2.6/v/missing
benjaoming
changed the title
[BUG] ModelSchema lists and custom HTTP status response={200: ..., 201: ...} doesn't work well
[BUG] paginate decorator with custom HTTP status response={200: ..., 201: ...} doesn't work
May 2, 2024
Describe the bug
It seems that customizing the status of a response by returning
<response_code>, object_list
doesn't work well for list views.Maybe it's difficult to fix, as the tuple is already iterable and will present itself as the object list itself?
But what is the workaround then?
Details
The following produces errors:
The error is as if we simply didn't supply the right object back... which kind of is true, but django-ninja is also supposed to understand the status code tuple?
However, this works fine:
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: