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

Simple examples not working #26

Open
Stefanqn opened this issue Nov 19, 2018 · 0 comments
Open

Simple examples not working #26

Stefanqn opened this issue Nov 19, 2018 · 0 comments

Comments

@Stefanqn
Copy link

package example

import cats.instances.list._
import pbdirect._

object Hello extends App {
  case class MyMessage( id: Option[Int], text: Option[String], numbers: List[Int])
  val message = MyMessage( id = Some(123),  text = Some("Hello"),  numbers = List(1, 2, 3, 4))

  println(List(message, message.copy(id = Some(999))).toPB.pbTo[List[MyMessage]])  //List(MyMessage(Some(123),Some(Hello),List(1, 2, 3, 4)))
  println(List(1, 2, 3).toPB.pbTo[List[Int]])
  /* Exception in thread "main" com.google.protobuf.InvalidProtocolBufferException:
  While parsing a protocol message, the input ended unexpectedly in the middle of a field.
  This could mean either that the input has been truncated or that an embedded message misreported its own length. */
}

with
sbt.version=1.2.6
and

lazy val root = (project in file(".")).
  settings(
    inThisBuild(List(
      organization := "com.example",
      scalaVersion := "2.12.7",
      version      := "0.1.0-SNAPSHOT"
    )),
    name := "pbdirectTest",
    resolvers += Resolver.bintrayRepo("beyondthelines", "maven"),
    libraryDependencies +=  "beyondthelines" %% "pbdirect" % "0.1.0"
  )

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