Skip to content

Instantly share code, notes, and snippets.

@adamdehaven
Created March 22, 2022 22:37
Show Gist options
  • Save adamdehaven/70b14b013ca77fba406afb54856a6735 to your computer and use it in GitHub Desktop.
Save adamdehaven/70b14b013ca77fba406afb54856a6735 to your computer and use it in GitHub Desktop.
JSON Patch before/after
{
"viewer": {
"name": "Viewer",
"description": "Read only access to all users",
"entity_instances": [
{
"id": "UUID-A"
},
{
"id": "UUID-B"
},
{
"id": "UUID-C"
},
{
"id": "UUID-D"
}
]
}
}
{
"viewer": {
"name": "Viewer",
"description": "Read only access to all users",
"entity_instances": [
{
"id": "UUID-B"
},
{
"id": "UUID-C"
},
{
"id": "UUID-D"
}
]
}
}
[
{
"op": "remove",
"path": "/viewer/entity_instances/3"
},
{
"op": "replace",
"path": "/viewer/entity_instances/2/id",
"value": "UUID-D"
},
{
"op": "replace",
"path": "/viewer/entity_instances/1/id",
"value": "UUID-C"
},
{
"op": "replace",
"path": "/viewer/entity_instances/0/id",
"value": "UUID-B"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment