Module json.move
Function: empty
Creates a new empty JSON object.
Inputs
Full prototype: public fun empty(): JsonObject
Function: data
Gets a reference to the inner SimpleMap.
Inputs
Full prototype: public fun data(json_obj: &JsonObject): &SimpleMap<JsonIndex, JsonElem>
json_obj: &JsonObjectValidation: None, but it must be of the correct type.
Impact: The JSON object whose inner
SimpleMapis returned as a reference.
Function: stringify
Computes the string representation of the passed-in JSON object.
Inputs
Full prototype: public fun stringify(json_obj: &JsonObject): String
json_obj: &JsonObjectValidation: None, but the object must be created through this module.
Impact: The object is converted into a string.
Function: parse
Turns a JSON-string representation into a JSON object.
Inputs
Full prototype: public fun parse(json_string: String): JsonObject
json_string: StringValidation: Validated while parsing.
Impact: The string that is converted into a JSON object.
Function: find
Finds the JsonIndex matching a string key in a JsonObject given a parent JsonIndex.
Inputs
Full prototype: public fun find(obj: &JsonObject, index: &JsonIndex, key: &String): JsonIndex
obj: &JsonObjectValidation: None, but the object must be created through this module.
Impact: The object on which the lookup is done.
index: &JsonIndexValidation: None, but the lookup of this index must succeed, or it will result in a revert.
Impact: This is the parent key where the lookup is performed.
key: &StringValidation: None necessary.
Impact: The string key being looked up.