Skip to content
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 custom protons options for limiting list/map sizes #120

Merged
merged 3 commits into from
Nov 1, 2023

Commits on Oct 23, 2023

  1. feat: add custom protons options for limiting list/map sizes

    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
    achingbrain committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    3758e63 View commit details
    Browse the repository at this point in the history
  2. chore: update option name

    achingbrain committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    d0e3513 View commit details
    Browse the repository at this point in the history
  3. chore: fix options proto

    achingbrain committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    c2d122e View commit details
    Browse the repository at this point in the history