Is there a way to pretty print a json string using...
# serialization
l
Is there a way to pretty print a json string using ktx serialization? I'm can't parse back the string to the original class because it's an internal class from an SDK, so using a JsonBuilder with prettyPrint = true doesn't solve the issue
b
How about
decodeFromString<JsonElement>()
with your non-pretty JSON, then encoding that JsonElement back to a string, except with pretty print?
A little clunky, but the pretty printing only happens during serialization, and since that's hidden behind an SDK, doing another serialization yourself seems like the next best thing if you want to use what's available