Skip to content

Commit 6cd3588

Browse files
idoqocvicentiu
authored andcommitted
Improve documentation of json parser functions
Signed-off-by: Michael Okoko <okokomichaels@outlook.com>
1 parent aafb888 commit 6cd3588

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

include/mysql/service_json.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@
2020
@file
2121
json service
2222
23-
Esports JSON parsing methods for plugins to use.
23+
Exports JSON parsing methods for plugins to use.
2424
25-
Fuctions of the service:
26-
js_type - returns the type of the JSON argument,
25+
Functions of the service:
26+
json_type - returns the type of the JSON argument,
2727
and the parsed value if it's scalar (not object or array)
2828
29-
js_get_array_item - expecs JSON array as an argument,
30-
and returns the n_item's item's type and value
29+
json_get_array_item - expects JSON array as an argument,
30+
and returns the type of the element at index `n_item`.
3131
Returns JSV_NOTHING type if the array is shorter
32-
than n_item and the actual length of the array in v_len.
32+
than n_item and the actual length of the array in value_len.
33+
If successful, then `value` up till `value[value_len]` contains the array
34+
element at the desired index (n_item).
3335
34-
js_get_object_key - expects JSON object as an argument,
35-
searches for a key in the object, return it's type and value.
36+
json_get_object_key - expects JSON object as an argument,
37+
searches for a key in the object, return it's type and stores its value in `value`.
3638
JSV_NOTHING if no such key found, the number of keys
3739
in v_len.
3840
39-
js_get_object_nkey - expects JSON object as an argument.
41+
json_get_object_nkey - expects JSON object as an argument.
4042
finds n_key's key in the object, returns it's name, type and value.
4143
JSV_NOTHING if object has less keys than n_key.
4244
*/

0 commit comments

Comments
 (0)