I think for better or worse, "what protoc implements" takes precedence over
whatever the spec says. The spec came later and as far as I know we have
not put a lot of effort into ensuring that it comprehensively matches the
format that protoc expects. I believe the syntax you are looking at is
missing from the .proto file format spec but is mentioned here
<https://developers.google.com/protocol-buffers/docs/proto#customoptions>
as the "aggregate syntax."

On Tue, Mar 23, 2021 at 1:02 PM Jeffory Orrok <[email protected]>
wrote:

> Is this URL still the official language specification for proto3?
> https://developers.google.com/protocol-buffers/docs/reference/proto3-spec
>
> I am encountering several projects that have multi-line, non-quoted text
> on the rhs of *option* assignments, sort of resembling what you would see
> as an object literal in JavaScript (not JSON, as the keys aren't quoted),
> but sometimes (not always) with semicolons instead of commas, or sometimes,
> no separator other than a newline, which is supposedly forbidden in a
> strLit.  I have even seen this in some Google .proto files, and it is
> vexing me to no end.
>
> For instance, here's a little snippet from googleapis/google/api/http.proto
> service Messaging {
>   rpc UpdateMessage(Message) returns (Message) {
>     option (google.api.http) = {
>       patch: "/v1/messages/{message_id}"
>       body: "*"
>     };
>   }
> }
>
> The protobufjs parser, *pbjs*, is usually unhappy with the semicolons,
> when it's not simply silently failing, but for whatever reason does not
> complain about the lack of quotes or the newlines.  Before I die on this
> hill, can anyone refer me to a spec addendum that I should know about?
>
> Thanks
>
> Jeff
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/18955ff8-1578-4877-a41f-dafcc5721dd8n%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/18955ff8-1578-4877-a41f-dafcc5721dd8n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr4ymW-d74vmNaNiVqprQczV%3D%2BEYO2x68GW2m1jiU1rDvg%40mail.gmail.com.

Reply via email to