protocolbuffers.github.io icon indicating copy to clipboard operation
protocolbuffers.github.io copied to clipboard

Note that Map fields cannot be `optional`

Open rossng opened this issue 1 year ago • 2 comments

This tripped me up: the documentation explicitly says that Map fields cannot be repeated, but it doesn't mention optional.

When trying to compile protobufs with a map<string, Foo>`, I get the following error:

rpc.proto:121:19:syntax error: unexpected '<'
rpc.proto:121:48:syntax error: unexpected '>'

See also: https://github.com/protobufjs/protobuf.js/issues/429

rossng avatar Dec 06 '24 09:12 rossng

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Dec 06 '24 09:12 google-cla[bot]

I generally don't sign CLAs. This change is so trivial that it's not copyrightable IMO - feel free to rewrite it yourselves.

rossng avatar Dec 06 '24 09:12 rossng