Skip to content

Variable number of parameters... #2466

Discussion options

You must be logged in to vote

Is this possible in mongoose?

What's possible in Mongoose is what is described in its documentation, examples and tutorials available.

https://mongoose.ws/documentation/#json
For your particular case I guess https://mongoose.ws/documentation/#mg_json_next might work ?

mongoose/test/unit_test.c

Lines 2790 to 2804 in d18b2b3

static void json_scan(struct mg_str json, int depth) {
int i, n = 0, o = mg_json_get(json, "$", &n);
for (i = 0; i < depth; i++) printf(" ");
printf("%.*s\n", n, json.ptr + o);
if (json.ptr[o] == '{' || json.ptr[o] == '[') { // Iterate over elems
struct mg_str key, val, sub = mg_str_n(json.ptr + o, (size_t) n);
size_t ofs = 0;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gbernaldo82
Comment options

Answer selected by scaprile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants