summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Okoko <okokomichaels@outlook.com>2021-07-22 12:40:15 +0100
committerVicențiu-Marian Ciorbaru <vicentiu@mariadb.org>2021-07-22 21:51:49 +0300
commit6cd3588f0e3c4736aff9af03ac2173a1a1b0c38e (patch)
tree1feb02a28a61e38faceefccce901bb2f477280d8
parentaafb88865796bf5d3aa8f131aba67adbec3694ce (diff)
downloadmariadb-git-6cd3588f0e3c4736aff9af03ac2173a1a1b0c38e.tar.gz
Improve documentation of json parser functions
Signed-off-by: Michael Okoko <okokomichaels@outlook.com>
-rw-r--r--include/mysql/service_json.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/mysql/service_json.h b/include/mysql/service_json.h
index 141b76279a5..cb748c0c83f 100644
--- a/include/mysql/service_json.h
+++ b/include/mysql/service_json.h
@@ -20,23 +20,25 @@
@file
json service
- Esports JSON parsing methods for plugins to use.
+ Exports JSON parsing methods for plugins to use.
- Fuctions of the service:
- js_type - returns the type of the JSON argument,
+ Functions of the service:
+ json_type - returns the type of the JSON argument,
and the parsed value if it's scalar (not object or array)
- js_get_array_item - expecs JSON array as an argument,
- and returns the n_item's item's type and value
+ json_get_array_item - expects JSON array as an argument,
+ and returns the type of the element at index `n_item`.
Returns JSV_NOTHING type if the array is shorter
- than n_item and the actual length of the array in v_len.
+ than n_item and the actual length of the array in value_len.
+ If successful, then `value` up till `value[value_len]` contains the array
+ element at the desired index (n_item).
- js_get_object_key - expects JSON object as an argument,
- searches for a key in the object, return it's type and value.
+ json_get_object_key - expects JSON object as an argument,
+ searches for a key in the object, return it's type and stores its value in `value`.
JSV_NOTHING if no such key found, the number of keys
in v_len.
- js_get_object_nkey - expects JSON object as an argument.
+ json_get_object_nkey - expects JSON object as an argument.
finds n_key's key in the object, returns it's name, type and value.
JSV_NOTHING if object has less keys than n_key.
*/