Skip to content
Commit 2f9b0d41 authored by Markus Fuchs's avatar Markus Fuchs Committed by Carles Cufí
Browse files

json: Add top-level array encoding support



The library supports the declaration of JSON arrays as both nested and
top-level elements. However, as the provided encoding functions
json_obj_encode() and json_obj_encode_buf() interpret all input
structures as objects, top-level arrays are encoded as

{"<field_name>":[{...},...,{...}]}

instead of

[{...},...,{...}].

Add new functions json_arr_encode() and json_arr_encode_buf() that
enable top-level JSON array encoding.

Signed-off-by: default avatarMarkus Fuchs <markus.fuchs@de.sauter-bc.com>
parent a6786c54
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment