Comments (5)
As a consumer of this library, some kind of index-independent syntax would also be nice:
json_object_dotset_string(obj, "array[]", "itemN");
Where "array[]"
indicates that the value should be appended to the array.
from parson.
Array notation is also something I was looking for. Like moe123's comment, some straightforward addressing scheme such as an_array.[1].an_object.key to access a certain element in an array will be very good.
from parson.
something like an_array.[1].an_object.key
would be easier.
is_key_index(const char * path_elem) { ... }
from parson.
Hi,
I tried your code:
JSON_Value *cloud_pkt_value = json_value_init_object();
JSON_Object *cloud_pkt_object = json_object(cloud_pkt_value);
json_object_dotset_string(cloud_pkt_object, "array[0]", "item0");
json_object_dotset_string(cloud_pkt_object, "array[1]", "item1");
and then added
char * serialized_string = json_serialize_to_string(cloud_pkt_value );
but when i print serialized_string, i get:
{"array[0]":"item0","array[1]":"item1"}
instead of { "array": ["item0", "item1"]}.
Can you explain better how to create arrays?
thanks
from parson.
@lidiahhh it's not implemented, it's only a suggestion.
from parson.
Related Issues (20)
- CModule fails on my CentOS device with opennssl error HOT 2
- LLVM clang 4.0.3 compliation - "%g is unsupported" HOT 4
- Excess precision for small floating point numbers. HOT 16
- kgabis.github.com/parson returns 404 HOT 1
- Is it possible to add option to ignoring the last comma? HOT 3
- Build using meson HOT 13
- JSON Merge HOT 1
- Question on errors - Get information about what failed HOT 1
- why not check the "processed" in parson.c
- clublog-users.json.zip HOT 1
- scan-build bugs
- Accepting invalid array HOT 1
- EOF not enforced HOT 1
- Completion of error handling
- Improve exception handling
- Segmentation fault after invoking json_object_clear() and json_object_remove() back to back. HOT 1
- What if enclosingn [] is missing? HOT 3
- sprintf hard-deprecated on MacOS prevents compiling HOT 3
- Validate JSON inputs HOT 3
- Unstable memory access conflicts that occur when running on Win7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parson.