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

Default codecs shadowed by magnolia, if they are not explicitly imported in scope #2

Open
vpavkin opened this issue Jun 18, 2018 · 0 comments
Labels
magnolia Issue depends on a fix in magnolia repo

Comments

@vpavkin
Copy link
Owner

vpavkin commented Jun 18, 2018

At the moment, for default codecs (for example, Encoder[List]) to be picked up, they have to be imported explicitly.
Otherwise, deriver uses Magnolia to derive codecs for any types which are either case classes or sealed traits. These derived codecs then override the default ones.

There's a way to properly prioritize magnolia macro, but to make this possible, major changes to magnolia are required. See softwaremill/magnolia#107

If you want to switch from circe-generic's auto to circe-magnolia's auto today, you would have to add additional imports to every place where derivation takes place:

// import all default codecs, defined in circe
import io.circe.Encoder._
import io.circe.Decoder._
// also import all codecs, defined in the companion objects of your own data definitions
import Foo._, Bar._
@vpavkin vpavkin added the magnolia Issue depends on a fix in magnolia repo label Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
magnolia Issue depends on a fix in magnolia repo
Projects
None yet
Development

No branches or pull requests

1 participant