Updated FAQ (markdown)

Benoît Blanchon
2016-01-13 21:07:40 +01:00
parent d75b04c1bc
commit 902dfd8b08

28
FAQ.md

@@ -277,7 +277,33 @@ void sendJson(JsonVariant json) {
}
```
See issue [#195](https://github.com/bblanchon/ArduinoJson/issues/195)
But in that case, you loose some specificities of the `JsonObject` class.
In particular, you don't have the `containsKey()` method.
If you need this function, you must cast the `JsonVariant` back to a `JsonObject&`.
For instance:
```c++
void myFunction(JsonVariant variant)
{
if (variant.is<JsonArray&>())
{
JsonArray& array = variant;
// ...
}
else if (variant.is<JsonObject&>())
{
JsonObject& object = variant;
// ...
  }
else
{
  // ...
}
}
```
See issue [#195](https://github.com/bblanchon/ArduinoJson/issues/195) and [#196](https://github.com/bblanchon/ArduinoJson/issues/196)
### What are the differences between `StaticJsonBuffer` and `DynamicJsonBuffer`?