I am trying to learn how to use patch method to partially update a table in a database. In RFC 5789, it is mentioned that:
The PATCH method requests that a set of changes described in the
request entity be applied to the resource identified by the
Request-URI. The set of changes is represented in a format called a
“patch document” identified by a media type.
Is application/json
considered a patch document? I am aware of RFC 7396 and RFC 6902, but both say that:
https://datatracker.ietf.org/doc/html/rfc7396
A JSON merge patch document describes changes to be made to a target JSON document
https://datatracker.ietf.org/doc/html/rfc6902
JSON Patch defines a JSON document structure for expressing a sequence of operations to apply to a JavaScript Object Notation (JSON) document
I am not making changes to a JSON document, but a database table. So is it OK to use just application/json
and not application/merge-patch+json
or application/json-patch+json
?