title: How to Create Nested Json Using ArduinoJson on ESP8266
body: <p>I want this Output Json From Esp8266</p>
  
  <p>I am trying with another json lib <a href="https://github.com/arduino-libraries/Arduino_JSON" rel="nofollow noreferrer">https://github.com/arduino-libraries/Arduino_JSON</a>
  this is lightweight library  than arduinojson.org </p>
  
  <pre><code>{
    "ID": "0785E7",
    "DEVICE": "SINGLE_RELAY",
    "Public_Name": "Demo Switch",
    "version": 1,
    "payloadVersion": 1,
    "SW": 1,
    "HW": 1,
    "CHIPSIZE": 1048576,
    "CHIPSPEED": 40000000,
    "CHIPMODE": 3,
    "capabilities": [
      {
        "interface": "Demo.Switch",
        "type": "ONOFF",
        "version": "1.0",
        "sync": true,
        "control_pin": 2,
        "MQTT_SWITCH_TOPIC": "on",
        "MQTT_SWITCH_SYNC": "sync"
      },
      {
        "interface": "Demo.Countdown",
        "type": "Countdown",
        "version": "1.0",
        "sync": true,
        "control_pin": 2,
        "MQTT_SWITCH_TOPIC": "s",
        "MQTT_SWITCH_SYNC": "x"
      },
      {
        "interface": "Demo.Schedule",
        "type": "Schedule",
        "version": "1.0",
        "sync": true,
        "control_pin": 2,
        "MQTT_SWITCH_TOPIC": "s",
        "MQTT_SWITCH_SYNC": "x"
      }
    ]
  }
  </code></pre>
  
  <p>Arduino Function</p>
  
  <pre><code>String Device_info()
  {
  
   JSONVar json;
    json["ID"] = ESPID;
    json["DEVICE"] = DEVICE_TYPE;
    json["Public_Name"] = DEVICE_CHANNEL;
    json["version"] = relaystatus1;
    json["payloadVersion"] = RelayPIN;
    json["SW"] = userid;
    json["HW"] = Trigger;
    json["CHIPSIZE"] = rssi_str;
    json["CHIPSPEED"] = "1";;
    String jsonString = JSON.stringify(json);
  
  }
  </code></pre>
  
  <p>i want to add "capabilities" objectArray in this Like Above json.</p>