Error since avro4s 1.9.0
See original GitHub issueThe following case happens in latest release only: v0.13.5
.
TestProtocol.scala
source code:
package mytest.domain
import freestyle.rpc.protocol.message
@message final case class ResponseValue(str: String = "ERROR")
@message final case class TestRequest(names: List[String])
@message final case class TestResponse(value: ResponseValue)
TestService.scala
source code:
package mytest
import mytest.domain.{TestRequest, TestResponse}
import freestyle.rpc.protocol._
@service trait TestService[F[_]] {
@rpc(AvroWithSchema)
def testMethod(request: TestRequest): F[TestResponse]
}
When trying to compile it, the following error occurs:
[error] <macro>:6:129: could not find implicit value for parameter e: io.grpc.MethodDescriptor.Marshaller[mytest.domain.TestResponse]
[error] _root_.io.grpc.MethodDescriptor.newBuilder(implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestRequest]], implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestResponse]]).setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("TestService", "testMethod")).build()
[error] ^
[error] <macro>:6:129: not enough arguments for method implicitly: (implicit e: io.grpc.MethodDescriptor.Marshaller[mytest.domain.TestResponse])io.grpc.MethodDescriptor.Marshaller[mytest.domain.TestResponse].
[error] Unspecified value parameter e.
[error] _root_.io.grpc.MethodDescriptor.newBuilder(implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestRequest]], implicitly[_root_.io.grpc.MethodDescriptor.Marshaller[TestResponse]]).setType(_root_.io.grpc.MethodDescriptor.MethodType.UNARY).setFullMethodName(_root_.io.grpc.MethodDescriptor.generateFullMethodName("TestService", "testMethod")).build()
[error] ^
[error] two errors found
[error] (server / Test / compileIncremental) Compilation failed
[error] Total time: 39 s, completed Jun 1, 2018 2:35:08 PM
But it works if:
- The default value is removed from
ResponseValue
. - Instead of importing the domain using
import mytest.domain.{TestRequest, TestResponse}
, usingimport mytest.domain._
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Broken typeclass derivation upgrading from 1.9.0 to 2.0.1 #235
I am using avro4s to auto-generate kafka serdes with a function that looked like this in 1.9.0: object AutoSerde { def apply[A]( implicit ......
Read more >sksamuel/avro4s - Gitter
But this fails with the error: requirement failed: Schema type for either ... is there a way in avro4s 1.9.0 to annotate the...
Read more >Defining Empty String in Avro Schema - java - Stack Overflow
Source: https://github.com/sksamuel/avro4s/issues/106. If it is possible, try to upgrade your Avro Decoder to 1.9.0 version.
Read more >Safety Considerations When Using Enums in Avro Schemas
How later versions of Avro fix the problem ... Since 1.9.0: A symbol default — informs the reader to use the default symbol...
Read more >Avro4s Macros - Maven Repository
Version Scala Vulnerabilities Repository Usages Date
2.0.x 2.0.4 2.13.0‑M5 · 2.12 Central 2
2.0.3 2.0.x 2.13.0‑M5 · 2.12 Central 1 Dec 02, 2018
2.0.2 2.0.x 2.13.0‑M4...
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
Let me verify this, thanks for the heads up
Thanks @fedefernandez for confirming! 🎉