Top level options with message fields incorrectly report syntax errors
eliaperantoni opened this issue · 2 comments
eliaperantoni commented
Describe the bug
A top level option
statement of message type, that has a nested message field, will report various errors, depending on how you place semicolons.
This happens even though the protobuf compiler is able to compile.
To Reproduce
Steps to reproduce the behavior:
- Clone this repo https://github.com/grpc-ecosystem/grpc-gateway
- Add import paths for the repo root folder and the
third_party/googleapis
subdirectory - Create a protobuf file with this content:
syntax = "proto3";
package proto;
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "MySite";
description: "MySite REST API";
version: "x.y.z";
};
host: "mysite";
base_path: "/grpc";
};
Expected behavior
No errors reported as the file can compile just fine (protobuf.js also works)
Plugin (please complete the following information):
- OS: Manjaro x64
- Plugin version: 0.13.0
- IDE: GoLand 2019.3.2
Additional context
I found out that this
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
host: "onocontroller:7576"
base_path: "/grpc"
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger).info = {
title: "ONO"
description: "ONO Lean Logistics REST API"
version: "x.y.z"
};
has the same effect but does not trigger any syntax error.
eliaperantoni commented
Sorry, tried searching but didn't found anything similar :/