Skip to content

Type hint field annotation on sealed trait enums #431

@nolledge

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions