kotlinx.serialization icon indicating copy to clipboard operation
kotlinx.serialization copied to clipboard

Support YAML (YML) officially

Open iocapps opened this issue 3 years ago • 4 comments

YAML is heavily used as a config format and far more relevant than some of the other formats that have first class support. I believe YAML should be supported officially instead of relying on 3rd party libraries mentioned in the docs.

iocapps avatar Jan 21 '22 17:01 iocapps

Non-JSON formats in the kotlinx.serialization have 'experimental' status, so not sure if this can be qualified as first-class support. Besides, what's wrong with 3rd party providers?

sandwwraith avatar Jan 24 '22 09:01 sandwwraith

Non-JSON formats in the kotlinx.serialization have 'experimental' status, so not sure if this can be qualified as first-class support. Besides, what's wrong with 3rd party providers?

True, they are experimental, but they are still prioritized over YAML. It would be great to have official YAML support from Kotlin team since there is smaller chance of it being abandoned, typically better code quality due to stricter standards, quicker to fix vulnerabilities, etc compared to 3rd party libraries.

iocapps avatar Jan 25 '22 18:01 iocapps

No one offers kotlin multiplatform yaml serialization , only jvm is supported mostly and others who do support kotlin multiplatform aren't feature complete

wakaztahir avatar Apr 15 '23 07:04 wakaztahir

There are some third-party multiplatform libraries available that enable the YAML format. kaml and yamlkt are two examples.

I strongly agree with @iocapps . Another thing to point out is that third-party libraries do not always offer the same level of consistency. As an example, I discovered that the yamlkt library exhibits distinct behavior and results compared to the JSON serializer provided by kotlinx.serialization, particularly in scenarios involving polymorphic serialization. I would love to witness the YAML format's support within kotlinx.serialization, even if in an experimental stage.

AngeloFilaseta avatar Mar 12 '24 09:03 AngeloFilaseta