We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 686a8f1 commit 2dbccbbCopy full SHA for 2dbccbb
core/json/src/test/scala/net/liftweb/json/FieldSerializerBugs.scala
@@ -42,6 +42,20 @@ object FieldSerializerBugs extends Specification {
42
str mustEqual """{"a-b*c":5}"""
43
read[WithSymbol](str) mustEqual s
44
}
45
+
46
+ "FieldSerialization should work with Options" in {
47
+ implicit val formats = DefaultFormats + FieldSerializer[ClassWithOption]()
48
49
+ val t = new ClassWithOption
50
+ t.field = Some(5)
51
+ read[ClassWithOption](Serialization.write(t)).field mustEqual Some(5)
52
+ }
53
54
+ case class WithSymbol(`a-b*c`: Int)
55
56
+ class ClassWithOption {
57
+ var field: Option[Int] = None
58
59
60
-case class WithSymbol(`a-b*c`: Int)
61
0 commit comments