-
Notifications
You must be signed in to change notification settings - Fork 119
Enumeration Support for Jerkson #8
Comments
+1 Also the following construct doesn't seem to work: sealed abstract class Status if one tries to serialize/deserialize the object containing such type, it is serialized as {} if we do something like: then it does put these values in when serializing, but crashes and returns null when tries to deserialize. |
I would dearly love to be able to serdes arbitrary algebraic data types. I have a lot of pairs of Foo and FooDTO classes. :( |
+1 |
3 similar comments
+1 |
+1 |
+1 |
I just tried hacking this, and I don't see any way to deserialize enumeration values:
Basically, if I say |
salat has _typeHint field for exactly that reason |
Ok, clever idea: _typeHint in salat I think that's not so desirable in this case since we'd have to give up |
Actually, Salat has a concept of context, and type hinting is just one thing in a context. I believe, it can be done in a more elegant way, like detecting what type it is by the fieldset of the JSON document being deserialized. But again, some types might have the same fieldsets, so then the deserializer shall need some hint. |
+1 |
1 similar comment
👍 |
It would be a great addition to Jerkson if it supported ser/deser of Scala Enumerations. Sample below:
object Day extends Enumeration {
val Mon, Tues, Wed, Thurs, Fri, Sat, Sun = Value
}
The text was updated successfully, but these errors were encountered: