-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create Array (not nested) from root JSONObject #272
Comments
Bonjour Charles, I don't know what DynamicJsonBuffer jsonBuffer;
JsonArray& root = jsonBuffer.createArray();
JsonObject & signal1 = root.createNestedObject();
signal1["ssid"] = "FreeWifi_secure";
// ... |
Benoit, Yeah the tips you give me works fine but since I migated my code with the Whole project ESPAsyncWebServer I don't have "hand" on the object creation, it's created in the class and I only got pointer on JSONObject and not a JSONArray (here the source declaration from AsyncJson)
So in this case, there is no way to create simple (so not nested) array from the root object ? |
Charles, |
Benoit, Merci, et bonne soirée |
Hey guys sorry to barge in your convo :) but what is the best option here? And what are the possible types that the root can be? Can a Variant become array/object or casted as? |
@me-no-dev, @me-no-dev, I migrated my full project to ESPasync, works fine, got some questions but I will open case on you github later for them ;-) |
@hallard in the latest commit :) maybe close the issue if that works for you. Will expect your questions :) |
Thanks, |
I'm using ArduinoJSon with new AsyncTCPWebServer for ESP8266 and it's working very well, thanks for the great job.
Anyway,
<AsyncJson.h>
is a great handler for AduinoJson object but I'm facing one problem that I can't solve, but may be I'm doing something wrong.I would like to start my JSON by an array, of course I can create root then nested array doing something like that without any problem (2 nested arrays)
But sometimes I need to have direct array as follow (for bootstraptable) and
createArray
seems not to be supported on root object (error at compile time) onlycreateNestedArray
worksOf course I could
CreateNestedArray("")
on root object but in this case I've got something like thisThe solution I was using was to do a
createArray()
on JSONbuffer and it worked, but since I'm using Async wrapper now, it create a root JSon object, not an array.Any tips would be appreciated
The text was updated successfully, but these errors were encountered: