The @JSONTypeHintField and @MongoTypeHintField annotations are only respected on sealed traits when they are present on each variation of that type. For sealed abstract classes it is sufficient to only put the annotation on the base-class.
I created a test scenarios here: 0ee1f85
The tests "JSONTypeHintField must be respected when only defined on sealed trait base-class" and "JSONTypeHintField must be respected when only defined on abstract class base-class"
in json/json-derivation/src/test/scala/io/sphere/json/generic/JsonTypeHintFieldSpec.scala
Show this difference in behaviour.
This commit also contains a test for the Mongo codec in an embedded context mongo/mongo-derivation/src/test/scala/io/sphere/mongo/generic/MongoEmbeddedSpec.scala
The @JSONTypeHintField and @MongoTypeHintField annotations are only respected on sealed traits when they are present on each variation of that type. For
sealed abstract classesit is sufficient to only put the annotation on the base-class.I created a test scenarios here: 0ee1f85
The tests "JSONTypeHintField must be respected when only defined on sealed trait base-class" and "JSONTypeHintField must be respected when only defined on abstract class base-class"
in json/json-derivation/src/test/scala/io/sphere/json/generic/JsonTypeHintFieldSpec.scala
Show this difference in behaviour.
This commit also contains a test for the Mongo codec in an embedded context mongo/mongo-derivation/src/test/scala/io/sphere/mongo/generic/MongoEmbeddedSpec.scala