question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SchemaFor/Encoder/Decoder implicits not resolved when using case classes with a default value

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sksamuelcommented, Nov 27, 2020

I’ve upgraded avro4s to use magnolia 0.17 and released this as avro4s 4.0.3.

0reactions
improved-broccolicommented, Jan 26, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found