From fc6ad51e68e76dcbcd1dae71709658ab1710a75f Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Thu, 24 Nov 2016 18:11:02 +0100 Subject: [PATCH] Added the workaround for issue #118 in StringExample.ino --- examples/StringExample/StringExample.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/StringExample/StringExample.ino b/examples/StringExample/StringExample.ino index 780cb435..46050329 100644 --- a/examples/StringExample/StringExample.ino +++ b/examples/StringExample/StringExample.ino @@ -33,7 +33,12 @@ void setup() { // You can get a String from a JsonObject or JsonArray: // No duplication is done, at least not in the JsonBuffer. - String sensor = root[String("sensor")]; + String sensor = root["sensor"]; + + // Unfortunately, the following doesn't work (issue #118): + // sensor = root["sensor"]; // <- error "ambiguous overload for 'operator='" + // As a workaround, you need to replace by: + sensor = root["sensor"].as(); // You can set a String to a JsonObject or JsonArray: // WARNING: the content of the String will be duplicated in the JsonBuffer.