The encoded Template or empty retrieval model, in any of the formats produced by encodeTemplate
Decoding options
Configuration options for decoding operations.
Optional Readonlybase?: IRIBase IRI for IRI resolution (must be absolute and hierarchical).
Resolves internal IRIs to absolute form.
If omitted, IRIs are resolved against the app namespace IRI (app:/#).
Optional Readonlylenient?: booleanDisables structural validation after decoding.
Allows the caller to handle validation independently using more advanced or specialised tools, for example for improved error reporting.
true, structural checks are skipped and only syntax errors are reported through exceptionsfalse, both syntax and structural errors are reported through exceptionsIf omitted, decoders apply internal structural validators to the input.
The decoded deeply immutable template with resolved IRIs, or the empty retrieval model
TypeError If base is not a hierarchical IRI
TypeError If the decoded value fails structural validation (unless lenient is true)
SyntaxError If encoded cannot be parsed as JSON, URL-encoded JSON, or
base64url-encoded JSON
Decodes a template from an encoded string.
Parses an encoded string into a Template, recursively resolving internal IRIs against the provided
base. The input encoding is auto-detected, accepting any of the output formats produced by encodeTemplate. The decoded template is validated and deeply frozen unlesslenientistrue.The empty retrieval model
{}is accepted alongside proper templates: it is an Atomic requesting nothing beyond the server defaults, and callers are expected to serve it as a request carrying no query component.