I had a very surprising compilation error with an even more surprising work around, I have 2 case class
case class DeviceMessage(rinfos: List[ReceiverInfo])case class ReceiverInfo(isNew: Option[Boolean] = Some(false))
and with the following code
import java.io.ByteArrayOutputStream
import com.sigfox.das.avro.models.v3.commons.models.device.DeviceMessage
import com.sksamuel.avro4s.AvroOutputStream
class AvroProducerMessagePrintLn {
val baos = new ByteArrayOutputStream()
val output = AvroOutputStream.binary[DeviceMessage](baos)
}
I have this compilation error:
Could not find implicit SchemaFor[com.sigfox.das.avro.models.v3.commons.models.device.DeviceMessage]
val output = AvroOutputStream.binaryDeviceMessage
I found a workaround by replacing
import com.sigfox.das.avro.models.v3.commons.models.device.DeviceMessage
by
import com.sigfox.das.avro.models.v3.commons.models.device.{ DeviceMessage, ReceiverInfo }
I think it's a scala compilation error and I'm not sure there is some way for you to avoid this error, but I thought I'm may be interesting to know this problem
Hello,
I had a very surprising compilation error with an even more surprising work around, I have 2 case class
case class DeviceMessage(rinfos: List[ReceiverInfo])
case class ReceiverInfo(isNew: Option[Boolean] = Some(false))
and with the following code import java.io.ByteArrayOutputStream import com.sigfox.das.avro.models.v3.commons.models.device.DeviceMessage import com.sksamuel.avro4s.AvroOutputStream
class AvroProducerMessagePrintLn { val baos = new ByteArrayOutputStream() val output = AvroOutputStream.binary[DeviceMessage](baos) } I have this compilation error: Could not find implicit SchemaFor[com.sigfox.das.avro.models.v3.commons.models.device.DeviceMessage] val output = AvroOutputStream.binaryDeviceMessage
I found a workaround by replacing
import com.sigfox.das.avro.models.v3.commons.models.device.DeviceMessage
byimport com.sigfox.das.avro.models.v3.commons.models.device.{ DeviceMessage, ReceiverInfo }
I think it's a scala compilation error and I'm not sure there is some way for you to avoid this error, but I thought I'm may be interesting to know this problem
I attach to the ticket a sbt project if you want to reproduce it or do more test. avro4sCompilationError.tar.gz
Thanks anyway for your work on avro4s
Regards, Pierre