How to use annotations.proto, http.proto?

1,479 views
Skip to first unread message

Jeff White

unread,
Nov 20, 2017, 2:05:12 PM11/20/17
to ScalaPB
Nadav,

How do you recommend we incorporate annotations.proto and http.proto from googleapis?

The grpc-gateway makes use of these.

I'm wondering if they should be added to scalapb-runtime or scalapb-runtime-grpc?

The other option would be to just copy them to my src/main/protobuf?

jeff



Nadav Samet

unread,
Nov 20, 2017, 2:47:04 PM11/20/17
to Jeff White, ScalaPB
Local copy or use something like this: https://stackoverflow.com/a/44298091/97524

--
You received this message because you are subscribed to the Google Groups "ScalaPB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/64c58981-e3c8-491c-a341-b31b14f71217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-Nadav

Jeff White

unread,
Nov 29, 2017, 2:19:13 PM11/29/17
to ScalaPB
Nadav,

I added annotations.proto and http.proto to src/main/protobuf/google/api, however when I compile:

import "google/api/annotations.proto";

service OneSvc {
    rpc SendEvent (Request) returns (Response) {
        option (google.api.http) = {
            post: "/v1/send-event"
            body: "*"
        };
    }
}


I get the following:

[error] .../target/scala-2.12/src_managed/.../v1/OneProto.scala:13:20: object com.google.api.AnnotationsProto is not a value
[error]     com.google.api.AnnotationsProto
[error]                    ^
[error] .../target/scala-2.12/src_managed/main/.../v1/OneProto.scala:35:39: value javaDescriptor is not a member of object com.google.api.AnnotationsProto
[error]       com.google.api.AnnotationsProto.javaDescriptor
[error]                                       ^
[error] two errors found

protoc command is (private info redacted):

protoc-jar: executing: [/var/folders/yy/gpycd7796s16jr_ngndlxhvw391rpx/T/protocjar3936951472404160475/bin/protoc.exe, --plugin=protoc-gen-scala=/var/folders/yy/gpycd7796s16jr_ngndlxhvw391rpx/T/protocbridge7331390539671738909, --scala_out=flat_package,grpc:/Users/.../target/scala-2.12/src_managed/main, -I/Users/.../src/main/protobuf, -I/Users/.../target/protobuf_external, /Users/.../src/main/protobuf/.../one.proto]

jeff


On Monday, November 20, 2017 at 11:47:04 AM UTC-8, Nadav Samet wrote:
Local copy or use something like this: https://stackoverflow.com/a/44298091/97524
On Mon, Nov 20, 2017 at 11:05 AM, Jeff White <jsw...@ebay.com> wrote:
Nadav,

How do you recommend we incorporate annotations.proto and http.proto from googleapis?

The grpc-gateway makes use of these.

I'm wondering if they should be added to scalapb-runtime or scalapb-runtime-grpc?

The other option would be to just copy them to my src/main/protobuf?

jeff



--
You received this message because you are subscribed to the Google Groups "ScalaPB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+u...@googlegroups.com.

To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/64c58981-e3c8-491c-a341-b31b14f71217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-Nadav

Jeff White

unread,
Nov 29, 2017, 2:29:11 PM11/29/17
to ScalaPB
Looks like a fix is to change

includeFilter in PB.generate := "one.proto"

to

includeFilter in PB.generate := ("one.proto" || "annotations.proto" || "http.proto")
Reply all
Reply to author
Forward
0 new messages