Skip to content

Note that Map fields cannot be optional#200

Closed
rossng wants to merge 1 commit intoprotocolbuffers:mainfrom
rossng:main
Closed

Note that Map fields cannot be optional#200
rossng wants to merge 1 commit intoprotocolbuffers:mainfrom
rossng:main

Conversation

@rossng
Copy link
Copy Markdown

@rossng rossng commented Dec 6, 2024

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: protobufjs/protobuf.js#429

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Dec 6, 2024

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.

@rossng
Copy link
Copy Markdown
Author

rossng commented Dec 6, 2024

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

@Logofile Logofile closed this Sep 10, 2025
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

Successfully merging this pull request may close these issues.

2 participants