https://kotlinlang.org logo
#serialization
Title
# serialization
j

jeggy

11/27/2023, 4:18 PM
How can I use the Hocon parser(
kotlinx-serialization-hocon
)? I'm having trouble figuring out how to parse anything from a file/string to a kotlin Serializable data class objects?
Hocon {}
only has access to
decodeFromConfig
and there's no
decodeFromString
or something the like?
s

Sergey Morgunov

11/28/2023, 3:47 PM
You can use a
com.typesafe.config.ConfigFactory#parseString
method to get a Config object from String
👍 1
d

Distractic

11/29/2023, 8:44 AM
In a previous version of a project, I use it. This is my Hocon reader, I hope that will help you
j

jeggy

11/29/2023, 3:25 PM
Thanks @Sergey Morgunov. Exactly what I was looking for