Skip to content

Type hint field annotation on sealed trait enums #431

Description

@nolledge

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions