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

scala.collection.mutable.Set cannot generate schema #861

Open
iblislin opened this issue Dec 13, 2024 · 0 comments
Open

scala.collection.mutable.Set cannot generate schema #861

iblislin opened this issue Dec 13, 2024 · 0 comments

Comments

@iblislin
Copy link

iblislin commented Dec 13, 2024

Hi, I ran into this issue:

scala> import scala.collection.mutable
                                                                                                                                                                          
scala> import com.sksamuel.avro4s.AvroSchema
                                                                                                                                                                          
scala> AvroSchema[mutable.Set[Int]]
-- [E172] Type Error: ----------------------------------------------------------
1 |AvroSchema[mutable.Set[Int]]
  |                            ^
  |No given instance of type com.sksamuel.avro4s.SchemaFor[scala.collection.mutable.Set[Int]] was found for parameter schemaFor of method apply in object AvroSchema.
  |I found:
  |
  |    com.sksamuel.avro4s.SchemaFor.autoDerived[scala.collection.mutable.Set[Int]](
  |      /* missing */
  |        summon[scala.deriving.Mirror.Of[scala.collection.mutable.Set[Int]]]
  |    )
  |
  |But Failed to synthesize an instance of type scala.deriving.Mirror.Of[scala.collection.mutable.Set[Int]]:
  |     * trait Set is not a generic product because it is not a case class
  |     * trait Set is not a generic sum because it is not a sealed trait.
1 error found

Is it okay to add the support for mutable.Set in this package, or I should add my own encoder/decoder locally in my project codebase?

If it's fine to include it in this project, I can try to make a PR. (well, my Scala skill is rusty. :p)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant