Create your own JSON data and save json file


I have tried ofxJSON addon. It works fine parsing JSON data from a certain url but I would like to create my own JSON data and save as a json file under the directory “data”. Does anyone know whether it’s possible with ofxJSON?


Yes, it certainly is. ofxJSON wraps jsoncpp.

Here is an examples:


Fantastic! I will try this example. Thanks a lot bakercp!

Thanks bakercp pointing to me a right direction. I was able to get the result I wanted. Here I have created steps blog post. Hope this helps some other people.


This is great! Thanks for making the write-up.

Thanks a lot, you show me the way on your website!

What about the alphabetical order thing? Any idea of how to handle it?

One big problem I have noticed. JSONCPP changes the order alphabetically in JSON format. I have looked into how prevent this alphabetical order but so far no luck. Not great but alternative solution might be adding index sort of number to the each element.