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
DJA uses DRF's viewsets.ModelViewset which includes both PUT (update()) and PATCH (partial_update()) methods. However, the JSONAPI spec only defines PATCH. DJA allows the PUT method. This becomes more apparent when using the new DRF openapi schema generator since it wants to document the PUT method. While DJA implements PUT identically to PATCH, it might be better to not expose this method as the PUT semantics defines a full replacement, which DJA's PUT does not do, since it's just implementing PATCH.
I'm not sure exactly where the PUT method gets defined but I think the change is to replace DRF's ModelViewSet with a DJA-specific version that replaces
DRF's mixins.UpdateModelMixin with one that doesn't define it.
DJA uses DRF's viewsets.ModelViewset which includes both PUT (update()) and PATCH (partial_update()) methods. However, the JSONAPI spec only defines PATCH. DJA allows the PUT method. This becomes more apparent when using the new DRF openapi schema generator since it wants to document the PUT method. While DJA implements PUT identically to PATCH, it might be better to not expose this method as the PUT semantics defines a full replacement, which DJA's PUT does not do, since it's just implementing PATCH.
I'm not sure exactly where the PUT method gets defined but I think the change is to replace DRF's ModelViewSet with a DJA-specific version that replaces
DRF's
mixins.UpdateModelMixin
with one that doesn't define it.django-rest-framework-json-api/rest_framework_json_api/views.py
Lines 189 to 192 in de7021f
You can see this by doing an
OPTIONS http://localhost:8000/blogs/1
as in this example:The text was updated successfully, but these errors were encountered: