The JSON-serialised Resource
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 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 resource with resolved IRIs
TypeError If base is not a hierarchical IRI
TypeError If the decoded value fails structural validation (unless lenient is true)
SyntaxError If json is not valid JSON
Decodes a resource state from a JSON string.
Parses a JSON string into a Resource, recursively resolving internal IRIs against the provided
base. The decoded resource is validated and deeply frozen unlesslenientistrue.