-
-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] paginate decorator with custom HTTP status response={200: ..., 201: ...}
doesn't work
#1147
Comments
There's a test case that seems to work well 🤔 django-ninja/tests/test_response_multiple.py Lines 71 to 73 in e7dc90e
|
Aha! It's the Indeed, maybe pagination shouldn't be expected to work seemlessly on a list view with many response types? |
aaaaand it's a duplicate of #940 👍 |
benjaoming
changed the title
[BUG] ModelSchema lists and custom HTTP status
[BUG] paginate decorator with custom HTTP status May 2, 2024
response={200: ..., 201: ...}
doesn't work wellresponse={200: ..., 201: ...}
doesn't work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: