skip to Main Content

Json – Unmarshalling protobufs in Scala

I have previously got Unmarshalling working in Scala using ScalaPB and the following marshallers: implicit def marshaller[T <: GeneratedMessage]: ToEntityMarshaller[T] = PredefinedToEntityMarshallers.ByteArrayMarshaller.compose[T](r => r.toByteArray) implicit def unmarshaller[T <: GeneratedMessage with GeneratedMessageCompanion[Request]](implicit companion: GeneratedMessageCompanion[Request]): FromEntityUnmarshaller[Request] = { Unmarshaller.byteArrayUnmarshaller.map[Request](bytes => companion.parseFrom(bytes)) }…

VIEW QUESTION
Back To Top
Search