You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The very nice mjson library really needs to support json fields with spaces in their names. For example, consider the following valid json:
{
"translations": {
"expression with spaces": {
"fr": "Translation of Expression1 in French",
"es": "Translation of Expression1 in Spanish",
"de": "Translation of Expression1 in German"
}
}
}
The following JSONpath statements are valid to perform a lookup:
$.["translations"]["expression with spaces"]["fr"]
$.translations."expression with spaces".fr
But none will work in mjson:
const char *s = \
"{"
"\"translations\": {"
"\"expression with spaces\": {"
"\"fr\": \"Translation of Expression1 in French\","
"\"es\": \"Translation of Expression1 in Spanish\","
"\"de\": \"Translation of Expression1 in German\""
"}"
"}"
"}\"";
const char *xp = "$.translations.\"expression with spaces\".fr";
char *p;
int m;
int n = mjson_find(s, strlen(s), xp, &p, &m);
mjson_find will always return zero.
As such, there is no way to construct a JSONpath statement to query JSON objects that contain spaces in their names using mjson. This is a trivial JSONpath statement, no fancy functions here.
The text was updated successfully, but these errors were encountered:
The very nice mjson library really needs to support json fields with spaces in their names. For example, consider the following valid json:
The following JSONpath statements are valid to perform a lookup:
But none will work in mjson:
mjson_find will always return zero.
As such, there is no way to construct a JSONpath statement to query JSON objects that contain spaces in their names using mjson. This is a trivial JSONpath statement, no fancy functions here.
The text was updated successfully, but these errors were encountered: