JSON Merge Patch
Jump to navigation
Jump to search
External
- https://datatracker.ietf.org/doc/html/rfc7386
- https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/
- https://erosb.github.io/post/json-patch-vs-merge-patch/
Internal
Overview
JSON merge patch is defined by RFC7386.
JSON merge patch defines a JSON document format appropriate for modifying a target JSON document. The format is suitable to use with the HTTP PATCH method and an "application/merge-patch+json" media type.
PATCH /target HTTP/1.1
Host: example.org
Content-Type: application/merge-patch+json
{
"a":"z",
"c": {
"f": null
}
}
Behavior on Lists
If a list is updated with JSON merge patch, a whole new list must be specified. The new list completely replaces the existing list.