Skip to content

Descriptor forms

A descriptor is the right-hand side of a pairing. It takes one of five forms.

Form Example Meaning
Pointer string "/a/b" read from the current source
Relative reference "../sibling" resolve against the source path (Extended)
Name string "mapping:Person" reference a registered mapping
Object { "source": "/a", "as": "number" } keyword descriptor
Array ["/a", "/b"] alternatives; first defined result wins

A pointer string is the common case:

/title: /book/title

An object composes keywords into a pipeline:

/year: { source: /book/published, as: number }

An array tries alternatives per evaluation:

/name: ['/nickname', '/fullName']

Relative references belong to the Extended tier and resolve against the current source path; see the JSON Pointer profile.

Name strings and $ref both reference the registry; see Registry keywords.

A string that is none of these forms is an error, not a read:

/v: not a pointer
valid: false
errors:
- { descriptor: not a pointer, message: unrecognized string descriptor }

The diagnostic names the string, so a typo fails loudly instead of quietly mapping the wrong thing.