sphere-scala-libs
sphere-scala-libs copied to clipboard
Using java annotations instead of scala type aliases does not work
Using java annotations directly has no effect. One have to use the scala type aliases.
Ex:
import io.sphere.mongo.generic.annotations.MongoKey
case class Student(
@MongoKey("_id") id: String
)
does not work.
The following works
import io.sphere.mongo.generic.MongoKey
case class Student(
@MongoKey("_id") id: String
)
https://github.com/sphereio/sphere-scala-libs/pull/52 was a try to fix that, but it does not really fix the issue.
An experimental branch is using magnolia for the derivation. It is only using scala annotation, fixing this issue: https://github.com/sphereio/sphere-scala-libs/tree/derive_with_magnolia