Import: json
The json import enables a Sentinel policy to parse and access a JSON document.
json.unmarshal(obj)
Unmarshals the JSON object obj
into a native Sentinel structure.
All native JSON types can be represented perfectly as Sentinel native types.
json.marshal(obj)
Marshals the Sentinel object obj
into a JSON object encoded as a string.
Sentinel's functions cannot be natively encoded, and will cause an error if it is present within the provided object.
Sentinel's undefined
cannot be natively encoded as JSON. If undefined
is supplied directly to marshal
, it will return undefined
. If undefined
is present within any map or list within the provided object, the associated
element will be removed prior to performing the JSON encoding.