This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 344
Unexpected error when formatting valid proto definition #24
Comments
This is an issue in emicklei/proto, see #1, we will need to file an issue over there. |
In fact, even when fixing this (removing the semicolons) and then running
syntax = "proto3";
import "google/api/annotations.proto";
service Test {
rpc Test(Void) returns (Void) {
option (google.api.http) = {
get: "/api/v1/test"
additional_bindings {
post: "/api/v1/test"
body: "*"
}
};
}
}
message Void {}
$ prototool format -w
$ prototool format -w
test.proto:7:44:1:1:Error while parsing option value for "http": Expected "{", found ".". The formatted file looks like this: syntax = "proto3";
import "google/api/annotations.proto";
service Test {
rpc Test(Void) returns (Void) {
option (google.api.http) = {
get: "/api/v1/test"
additional_bindings.post: "/api/v1/test"
additional_bindings.body: "*"
};
}
}
message Void {} |
I could raise a separate issue for this case if you wish? |
I’d prefer the relevant issues be filed in emicklei/proto, no need to create new issues here. A test case in a PR to reproduce the above would be good too. |
This was referenced Apr 12, 2018
Raised emicklei/proto#79 and emicklei/proto#80, I also raised #27 so we can make a decision on what should be done for that case. Closing this. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following protofile produces a pretty hard-to-debug error when linting (and probably for other stuff as well):
The error:
Specifically, it's the semicolons inside the
options
object that the parser doesn't like.This is, of course, a perfectly valid protofile definition (as
protoc
accepts it), though I admit I'm having trouble finding a definition for multi-value options. See https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#option, https://developers.google.com/protocol-buffers/docs/proto#customoptions for more information. The latter lists a single example of a multi-value option where all options are on the same line, without semicolon;So perhaps this could be a linter option? In any case the parser should allow it.
The text was updated successfully, but these errors were encountered: