Expand description
Implementations of Json
cheatcodes.
Functionsยง
- Canonicalize a json path key to always start from the root of the document. Read more about json path syntax: https://goessner.net/articles/JsonPath/
- encode ๐
- json_
to_ ๐sol - json_
value_ ๐to_ token Converts a JSONValue
to a [DynSolValue
] by trying to guess encoded type. For safer decoding, useparse_json_as
. - parse_
json ๐ - parse_
json_ ๐array - parse_
json_ ๐as Parses given serde_json::Value as a [DynSolValue]. - parse_
json_ ๐coerce - parse_
json_ ๐keys - parse_
json_ ๐map - parse_
json_ ๐str - resolve_
type ๐Resolves a [DynSolType] from user input. - select ๐
- serialize_
json ๐Serializes a key:value pair to a specific object. If the key is valueKey, the value is expected to be an object, which will be set as the root object for the provided object key, overriding the whole root object if the object key already exists. By calling this function multiple times, the user can serialize multiple KV pairs to the same object. The value can be of any type, even a new object in itself. The function will return a stringified version of the object, so that the user can use that as a value to a new invocation of the same function with a new object key. This enables the user to reuse the same function to crate arbitrarily complex object structures (JSON). - Serializes given [DynSolValue] into a serde_json::Value.