How to import firestore's RPC api/definitions in a .proto file?

318 Views Asked by At

Wrt a scala application for interacting with firestore's RPC apis, and using scalapb proto compiler /akka-grpc middleware, how to import the firestore RPC API's definitions in the .proto files? Eg. how to import the Document definition?

Trying to plainly say import "google.firestore.v1beta1.Document"; gives error.

1

There are 1 best solutions below

0
sidnt On

take a look at https://github.com/thesamet/sbt-protoc/blob/master/examples/multi-with-external-jar/build.sbt
You need to add libraryDependencies += "com.google.api.grpc" % "proto-google-cloud-firestore-v1beta1" % "0.37.0" % "protobuf", which will make sbt-protoc extract the protos into a subdirectory of target/protobuf_external If you want ScalaPB to generate Scala classes for them, then also add PB.protoSources in Compile += target.value / "protobuf_external" / "com" / "google"