@@ -419,7 +419,11 @@ def _get_validated_json_payload(self, related_type_) -> dict:
419419
420420 @check_method_requirements
421421 def post (self , * args , ** kwargs ):
422- """Add / create relationship(s)"""
422+ """
423+ Add / create relationship(s)
424+
425+ https://jsonapi.org/format/#crud-updating-to-many-relationships
426+ """
423427 relationship_field , model_relationship_field , related_type_ , related_id_field = self ._get_relationship_data ()
424428 json_data = self ._get_validated_json_payload (related_type_ )
425429 self .before_post (args , kwargs , json_data = json_data )
@@ -441,7 +445,23 @@ def post(self, *args, **kwargs):
441445
442446 @check_method_requirements
443447 def patch (self , * args , ** kwargs ):
444- """Update a relationship"""
448+ """
449+ Update a relationship
450+
451+ # https://jsonapi.org/format/#crud-updating-relationship-responses-200
452+
453+ > If a server accepts an update but also changes the targeted relationship(s)
454+ > in other ways than those specified by the request,
455+ > it MUST return a 200 OK response.
456+ > The response document MUST include a representation
457+ > of the updated relationship(s).
458+
459+ > A server MUST return a 200 OK status code if an update is successful,
460+ > the client’s current data remain up to date,
461+ > and the server responds only with top-level meta data.
462+ > In this case the server MUST NOT include a representation
463+ > of the updated relationship(s).
464+ """
445465 relationship_field , model_relationship_field , related_type_ , related_id_field = self ._get_relationship_data ()
446466
447467 json_data = self ._get_validated_json_payload (related_type_ )
0 commit comments