I have a generic JSON Object with the key "data". The value for that key can be any vaild JSON value (array, object, string, number..). Example:
{data:["One","Two","Three"]}
Now I need the value of "data" as a string and this must be generic because the value can be of any type. So far I tried this way:
JsonObject jsonObj = (JsonObject) message.body();
String data = jsonObj.getString("data");
But the problem is, that the method getString("data") results in an exception
java.lang.ClassCastException: io.vertx.core.json.JsonArray cannot be cast to java.lang.CharSequence
at io.vertx.core.json.JsonObject.getString(JsonObject.java:82)
Any ideas?