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.

Case Class could not find implicit encoder when Scala Collection is turned into Java One

See original GitHub issue

Hello everyone.

I am trying to parse a Json with a model based on this case class case class MyCaseClass(field: String, collection: Vector[String])

Everything is fine but I’d prefer using this version. case class MyCaseClass(field: String, collection: java.util.Collection[String])

As soon as I turn to this version, I get

Information:10/16/19 5:24 PM - Compilation completed with 2 errors and 0 warnings in 3 s 99 ms
    Error:Error:line (33)could not find implicit value for parameter d: io.circe.Decoder[models.MyCaseClass]
...
    Error:Error:line (33)not enough arguments for method as: (implicit d: io.circe.Decoder[models.MyCaseClass])io.circe.Decoder.Result[models.MyCaseClass].
Unspecified value parameter d.
...

Is it wrong using Java Collections with Circe?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
plokhotnyukcommented, Oct 16, 2019

@alessandrolumino why not just use a Scala library for serialization to Avro?

https://github.com/topics/avro?l=scala

0reactions
skyluminoacommented, Oct 17, 2019

By the way, I used avro4s!

Read more comments on GitHub >

github_iconTop Results From Across the Web

scala could not find implicit value for parameter encoder
This works: import io.circe._ import io.circe.generic.auto._ import io.circe.syntax._ scala> Map("key" -> "hello".asJson, "boolean" -> true.
Read more >
circe/circe - Gitter
I am using circe in a Flink project and I got an issue with the built-in Encoder for TraversableOnce as sadly Flink relies...
Read more >
Getting Started - Spark 3.3.1 Documentation
Programmatically Specifying the Schema. Scala; Java; Python. When case classes cannot be defined ahead of time ( ...
Read more >
Custom Mappings · doobie - tpolecat
single -element case classes wrapping one of the above types. The java.time instances may require a separate import , dependent on your Database...
Read more >
Serializers for Classes in Datasets - FullContact
These implicit values make it possible for the Dataset to have the necessary Encoder for a type the Dataset did not know existed...
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