retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

[Kotlinx Serialization Converter] Shouldn't it support also stringConverter?

Open lsuski opened this issue 2 months ago • 1 comments

Hi, my question is if retrofit2.converter.kotlinx.serialization.Factory should support by default or configurable stringConverter. By default it returns null which means that for example query parameters which are enums are serialized using toString. This might be confusing as not everyone are aware what is inside such converter.

lsuski avatar Oct 13 '25 08:10 lsuski

If you serialize an enum with something like Json, you'll get "TheName" as opposed to TheName which likely will surprise people. This has come up a lot in the past, which you can see by searching "quotes" in the closed issues.

I don't really want to enable this by default (for any converter), but I'm not opposed to adding a helper to enable it for text-based formats.

JakeWharton avatar Oct 14 '25 15:10 JakeWharton