Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json object in json array #87

Open
EkaCreativeSolutions opened this issue Apr 19, 2017 · 2 comments
Open

json object in json array #87

EkaCreativeSolutions opened this issue Apr 19, 2017 · 2 comments

Comments

@EkaCreativeSolutions
Copy link

Is possible add one or more json object in a json array?

@rvdende
Copy link

rvdende commented Jul 19, 2017

aJsonObject* root = aJson.createArray();

aJsonObject* day;
day=aJson.createItem("Monday");
aJson.addItemToArray(root, day);

@bltDefender
Copy link

bltDefender commented May 13, 2018

I would like to add a more complex object:

aJsonObject* root = aJson.createObject();
aJsonObject* logicalDevices = aJson.createArray();
aJsonObject* device = aJson.createObject();
aJson.addStringToObject(device, "command" , "setColor");
aJson.addItemToArray(logicalDevices, device);
aJson.addItemToObject(root, "devicelist" logicalDevices);

Doing so results in a broken JSON tree. Any way to do this? Or does this break JSON schema?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants