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
Ben Woodworth
05/28/2024, 1:42 AM
How about
decodeFromString<JsonElement>()
with your non-pretty JSON, then encoding that JsonElement back to a string, except with pretty print?
Ben Woodworth
05/28/2024, 1:46 AM
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