-
Notifications
You must be signed in to change notification settings - Fork 4
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
Boilerplate code - Declaring Codecs often requires more Codecs #7
Comments
Let's assess https://github.com/plokhotnyuk/jsoniter-scala in this context |
Hmm... |
Hmmm okay but jsoniter claims that it can cooperate with Borer somehow (generate Borer-compatible codecs?)... this is probably going to be useful for our use case (?) |
@sirthias can you think of any ready solution here? Like jsoniter-scala or sth else Magnolia-based? |
borer derivation is intentionally not fully "auto-magic", because this often leads to issues down the road. Consider this snippet for example: case class Foo(int: Int, qux: Qux)
case class Bar(qux: Qux)
case class Qux(...) If In this small example this might not be an issue but for large model hierarchies these kinds of invisible duplications can create huge amounts of code, that takes a long time to compile and can create a number of strange issues. In our experience it's indeed better to manually cache codecs for all types in |
Okay, that's a valuable point... so maybe we @MarconZet should not go down this rabbit hole indeed, and instead focus on #5 to prevent runtime errors |
When declaring Codec[A], if class A has a field of class B, then Codec[B] must also be declared.
The text was updated successfully, but these errors were encountered: