You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I break down my use case into a minimal example, I'd like to deserialize a yaml similar to this:
name: Peter
values:
key: val
key2:
- val2
into a class that has some properties and one of them should contain the yaml without an explicit structure. This would be ideal
@Serializable
data class Person(
val name: String,
val values: Map<String, Any>
)
but such map cannot be used for serialization because of Any type. I was thinking if YamlNode (or something else used internally by kaml) could be used but it isn't serializable either. Could you help me if there's a way to achieve that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When I break down my use case into a minimal example, I'd like to deserialize a yaml similar to this:
into a class that has some properties and one of them should contain the yaml without an explicit structure. This would be ideal
but such map cannot be used for serialization because of
Any
type. I was thinking ifYamlNode
(or something else used internally by kaml) could be used but it isn't serializable either. Could you help me if there's a way to achieve that?Beta Was this translation helpful? Give feedback.
All reactions