Parse json String with forward slash in Gson
I have to retrieve data from a rest api which just returns a String without any json format which also contains a forward slash which shouldn't be escaped. When I for example try to parse this:
Gson().fromJson("foo/bar", String::class.java)
I get the following error:
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 5 path $
But when I then try the setLenient like this:...