Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hint field annotation on sealed trait enums #431

Open
nolledge opened this issue Sep 6, 2022 · 0 comments
Open

Type hint field annotation on sealed trait enums #431

nolledge opened this issue Sep 6, 2022 · 0 comments

Comments

@nolledge
Copy link
Contributor

nolledge commented Sep 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant