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

Support for proto3 syntax #210

Closed
vanvlack opened this issue Jun 19, 2015 · 4 comments
Closed

Support for proto3 syntax #210

vanvlack opened this issue Jun 19, 2015 · 4 comments

Comments

@vanvlack
Copy link

I was wondering if this is on the release plan for 1.8.0 or at some point in the future.

With proto3, certain keywords are no longer supported required and implied on each field optional. Currently, wire will fail if a proto3 is inputted into it.

12:52:55 {master} ~/Development/vanvlack/test $ java -jar wire-compiler-1.8.0-SNAPSHOT-jar-with-dependencies.jar --proto_path=. --java_out=out src/main/proto/test.proto --service_writer=com.squareup.wire.SimpleServiceWriter
Exception in thread "main" java.lang.IllegalStateException: Syntax error in ./src/main/proto/test.proto at 13:10: unexpected label: fixed64
    at com.squareup.protoparser.ProtoParser.unexpected(ProtoParser.java:904)
    at com.squareup.protoparser.ProtoParser.readDeclaration(ProtoParser.java:197)
    at com.squareup.protoparser.ProtoParser.readMessage(ProtoParser.java:219)
    at com.squareup.protoparser.ProtoParser.readDeclaration(ProtoParser.java:153)
    at com.squareup.protoparser.ProtoParser.readProtoFile(ProtoParser.java:92)
    at com.squareup.protoparser.ProtoParser.parse(ProtoParser.java:56)
    at com.squareup.wire.IO$FileIO.parse(IO.java:41)
    at com.squareup.wire.WireCompiler.compile(WireCompiler.java:176)
    at com.squareup.wire.WireCompiler.main(WireCompiler.java:98)
syntax = "proto3";

package test;

service ExampleService {
  /* Gets all example data. */
  rpc GetAllExampleData (ExampleRequest) returns (ExampleResponse);
}

message ExampleRequest {}

message ExampleResponse {
  fixed64 id = 1;
  string data = 2;
}

https://developers.google.com/protocol-buffers/docs/proto3#simple

@JakeWharton
Copy link
Member

This was tentatively slated for v2 along with some other architectural changes. Work probably won't begin until more into the summer. ProtoParser was already updated with full proto3 syntax support though.

@vanvlack
Copy link
Author

@JakeWharton thanks

I'm guessing moving from JavaWriter to JavaPoet is also slated for v2?

@JakeWharton
Copy link
Member

Yes. I'm working on releasing 1.8.0 this weekend so we can start this work!

@swankjesse swankjesse mentioned this issue Jul 20, 2015
46 tasks
@swankjesse
Copy link
Member

Moving this into #279.

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

3 participants