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

Lock file does not record aggregate options with array values #117

Closed
rmichela opened this issue Aug 29, 2019 · 3 comments
Closed

Lock file does not record aggregate options with array values #117

rmichela opened this issue Aug 29, 2019 · 3 comments

Comments

@rmichela
Copy link

rmichela commented Aug 29, 2019

Reproduction

  1. Construct a message with a field with a compound option with an array value.
message FloatIn { float val = 1 [(validate.rules).float = {in: [4.56, 7.89]}]; }
  1. Run protolock init
  2. Inspect proto.lock

Expected

  • Lock file tracks option values

Actual

  • Lock file tracks option presence and name, but value is missing.
          {
            "name": "FloatIn",
            "fields": [
              {
                "id": 1,
                "name": "val",
                "type": "float",
                "options": [
                  {
                    "name": "(validate.rules).float",
                    "aggregated": [
                      {
                        "name": "in"
                      }
                    ]
                  }
                ]
              }
            ]
          },
@nilslice
Copy link
Owner

Thanks for reporting, @rmichela - do you have a fix in mind or had this just popped up and you're looking for help?

I believe @aroch provided this feature, so maybe if we ask nicely 😄 he can take a look! Otherwise, I will have to carve out some time next week to dig in.

@rmichela
Copy link
Author

rmichela commented Aug 29, 2019

I don't have a fix in mind (yet). The issue came up while developing a protolock plugin for protoc-gen-validate, which makes heavy use of compound options.

@aroch
Copy link
Contributor

aroch commented Aug 31, 2019

You're correct, I did not support compound options. I started working on a fix, but will need a bit more time to finalise and create a PR.

aroch added a commit to aroch/protolock that referenced this issue Sep 1, 2019
nilslice added a commit that referenced this issue Sep 17, 2019
fixes #117 - supporting nested structures in options (arrays, maps)
nilslice added a commit that referenced this issue Sep 17, 2019
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

No branches or pull requests

3 participants