-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add protons extension #14505
feat: add protons extension #14505
Conversation
Adds an extension id to the registry for use by the [protons](https://www.npmjs.com/package/protons) protobuf encoder/decoder.
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. |
Adds the capability to define protons-specific custom options that control decoding behaviour initially around limiting the sizes of maps and lists. ```protobuf // import the options definition - it will work without this but some // code editor plugins may report an error if the def can't be found import "protons-rutime/options.proto"; message MessageWithSizeLimitedRepeatedField { // define the size limit - here more than 10 repeated items will // cause decoding to fail repeated string repeatedField = 1 [(protons.limit) = 10]; } ``` The defintion is shipped with the `protons-runtime` module. There is a [pending PR](protocolbuffers/protobuf#14505) to reserve the `1186` field ID. This should be merged first and/or the field ID updated here if it changes due to that PR. Fixes #113
@acozzette @fowles sorry to ping you directly but it looks like you've recently merged PRs that add extension number reservations - what needs to happen for this to be merged? |
@acozzette thanks for approving! It looks like there's an internal check that failed so it wasn't merged? I can't access the "Details" link, it must be some internal Google thing? |
@achingbrain Sorry for the delay, I was able to get it unstuck so that it has now been submitted. |
That's great, thanks so much |
Adds the capability to define protons-specific custom options that control decoding behaviour initially around limiting the sizes of maps and lists. ```protobuf // import the options definition - it will work without this but some // code editor plugins may report an error if the def can't be found import "protons.proto"; message Message { // define the size limit - here more than 10 repeated items will // cause decoding to fail repeated string repeatedField = 1 [(protons.options).limit = 10]; } ``` The definition is shipped with the `protons-runtime` module. There is a [pending PR](protocolbuffers/protobuf#14505) to reserve the `1186` field ID. This should be merged first and/or the field ID updated here if it changes due to that PR. Fixes #113
Adds an extension id to the registry for use by the protons protobuf encoder/decoder.