Skip to content

Instantly share code, notes, and snippets.

@handrews
Last active February 21, 2023 22:33
Show Gist options
  • Save handrews/62d9ae0abe8938c910f7f4906cfa53f9 to your computer and use it in GitHub Desktop.
Save handrews/62d9ae0abe8938c910f7f4906cfa53f9 to your computer and use it in GitHub Desktop.
Additional Relative JSON Pointer examples for index manipulation
[
"foo",
"bar",
{"baz": "value"}
]
Starting value Relative JSON Pointer result
-------------------------------------------------------------------------
"foo" "0+1" "bar"
"bar" "0-1#" 0
"foo" "0+2/baz" "value"
"value" "1-2" "foo"
"value" "1+1" << fail >>
"value" "0+1" << fail >>
"bar" "0-2" << fail >>
"foo" "1+1/2/baz" << fail >>
"foo" "0/anything" << fail >>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment