-
Notifications
You must be signed in to change notification settings - Fork 248
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
Support annotating a PATCH
@action
with @extend_schema
to use PatchedTRequest
#1227
Comments
This code seems relevant to this issue drf-spectacular/drf_spectacular/plumbing.py Lines 170 to 176 in a79bc5d
|
I was able to manually add @extend_schema_view(
bulk_partial_update=extend_schema(
request=TSerializer(many=True, partial=True), responses=TSerializer(many=True)
),
) |
So the only issue I have remaining is that for bulk partial updates, I need to have the required As an example of what the partial update data looks like: [
{"id": 1, "name": "fred"},
{"id": 2, "age": 10}
] |
I have an
@action
of the form:And a
ViewSet
of the form:I was hoping that because the
@action
was tagged asHTTPMethod.PATCH
thatdrf-spectacular
would automatically use thePatchedTRequest
form of the generatedT
for therequest
side of the API sincePATCH
is used in HTTP for partial updates.But when I looked at the generated OpenAPI spec, I found it looked like:
Specifically I was hoping that
requestBody
would usePatchedTRequest
.The text was updated successfully, but these errors were encountered: