SchemaFor/Encoder/Decoder implicits not resolved when using case classes with a default value
See original GitHub issueWhen a case class have a field with a default value and a this
constructor which sets field default value, this is how avrohugger generates case class implementing SpecificRecord API, compilation fail and output this:
could not find implicit value for evidence parameter of type com.sksamuel.avro4s.SchemaFor
Here is a snippet which reproduce the bug: https://scastie.scala-lang.org/mdQzDpRCQka2FnH80tDOSg
The bug happen under Scala 2.13.3 with latest version of avro4s and avrohugger. But it appears to be a regression since it works until avro4s 3.0.9 and get broken from 3.1.0.
Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
SchemaFor/Encoder/Decoder implicits not resolved when using ...
When a case class have a field with a default value and a this constructor which sets field default value, this is how...
Read more >sksamuel/avro4s - Gitter
I'm using a library that uses an Encoder to encode value for a Schema. The schema generated by the macro picks up the...
Read more >Implicitly getting Schema from class with type Alias
I'm currently using sttp version 3.3.14 with tapir version 0.18.0-M15 and I'm having trouble with the Schemas of certain case classes.
Read more >Case Study: Deriving Spark Encoders and Schemas Using ...
To resolve this situation, we have to write an encoder for ISBNs first, and make it available in the callsite's scope. Spark provides...
Read more >A Deep Dive Into Spark Datasets and DataFrames Using Scala
-Creating a DataFrame using case classes ... To create a Dataset in Spark, we need an encoder that is responsible for encoding and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve upgraded avro4s to use magnolia 0.17 and released this as avro4s 4.0.3.
Now works on 4.0.3+ https://scastie.scala-lang.org/UIQVRzPQQfGLlV7YA2kz3g Thanks @sksamuel