links
public abstract Link[] links
6.2.1. slash-delimited fragment resolution
With the slash-delimited fragment resolution protocol, the fragment
identifier is interpreted as a series of property reference tokens
that start with and are delimited by the "/" character (\x2F). Each
property reference token is a series of unreserved or escaped URI
characters. Each property reference token SHOULD be interpreted,
starting from the beginning of the fragment identifier, as a path
reference in the target JSON structure. The final target value of
the fragment can be determined by starting with the root of the JSON
structure from the representation of the resource identified by the
pre-fragment URI. If the target is a JSON object, then the new
target is the value of the property with the name identified by the
next property reference token in the fragment. If the target is a
JSON array, then the target is determined by finding the item in
array the array with the index defined by the next property reference
token (which MUST be a number). The target is successively updated
for each property reference token, until the entire fragment has been
traversed.
Property names SHOULD be URI-encoded. In particular, any "/" in a
property name MUST be encoded to avoid being interpreted as a
property delimiter.
For example, for the following JSON representation:
{
"foo":{
"anArray":[
{"prop":44}
],
"another prop":{
"baz":"A string"
}
}
}
The following fragment identifiers would be resolved:
fragment identifier resolution
------------------- ----------
# self, the root of the resource itself
#/foo the object referred to by the foo property
#/foo/another%20prop the object referred to by the "another prop"
property of the object referred to by the
"foo" property
#/foo/another%20prop/baz the string referred to by the value of "baz"
property of the "another prop" property of
the object referred to by the "foo" property
#/foo/anArray/0 the first object in the "anArray" array
6.2.2. dot-delimited fragment resolution
The dot-delimited fragment resolution protocol is the same as slash-
delimited fragment resolution protocol except that the "." character
(\x2E) is used as the delimiter between property names (instead of
"/") and the path does not need to start with a ".". For example,
#.foo and #foo are a valid fragment identifiers for referencing the
value of the foo propery.
- Default:
- {}