I am getting a response from a firebase function and dialogflow which hold some information that I need for further implementations.
The response is a JSON, which I hold in mResultFromDialogFlow, which is a HashMap (String, Object) type variable.
I've searched other threads like this, but the strange thing was that my problem is at column 2, not 1 and I don't see the problem in the json. Here is the gson part. The error is thrown on the line with Properties!
Gson _gson = new Gson();
String _json = _gson.toJson(mResultFromDialogFlow.get("parameters"));
Properties data = _gson.fromJson(_json, Properties.class);
mTime = data.getProperty("date"); // String type variable
mDateFromUser = data.getProperty("time"); // String type variable
This is the response JSON:
{"date":"2019-07-19T12:00:00+03:00","time":"2019-07-19T14:00:00+03:00"}
Propertiesare you using?java.util.Properties?_jsonhas this value:"{\"time\":\"2019-07-19T14:00:00+03:00\",\"date\":\"2019-07-19T12:00:00+03:00\"}"@MC Emperor, yes{not a"mResultFromDialogFlow.get("parameters")already returns a JSON string. WithtoJson(), you convert a JSON string to JSON. What happens if you tryProperties data = _gson.fromJson(mResultFromDialogFlow.get("parameters"));?mResultFromDialogFlowdirectly to_gson.fromJson