Module json_utils

Source
Expand description

Collection of utilities for working with JSON

Traits§

JsonToNum
Trait to convert a JSON structure to a number

Functions§

body_from_json
Returns the body from the JSON struct with the provided field name
get_field_as_string
Look up a field and return it as a string value
hash_json
Hash function for JSON struct
headers_from_json
Returns the headers from a JSON struct as Map String -> Vec
headers_to_json
Converts the headers map into a JSON struct
is_empty
If the JSON value is empty
json_deep_merge
Deep merges the other value into the given value
json_to_num
Converts an optional JSON struct to a usize, returning None if it is not a numeric type.
json_to_string
Converts the JSON struct to a String, first checking if it is a JSON String