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

Support field references in min and max options #64

Open
alexander-yevsyukov opened this issue Oct 27, 2022 · 1 comment
Open

Support field references in min and max options #64

alexander-yevsyukov opened this issue Oct 27, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@alexander-yevsyukov
Copy link
Collaborator

alexander-yevsyukov commented Oct 27, 2022

Suppose, I have the following type definition:

message Range {
    int32 min_value = 1;
    int32 max_value = 2;
}

Obviously, the following should apply:

  1. min_value <= max_value
  2. max_value >= min_value, which is just an opposite of the item 1.

Can we do it now like this?

message Range {
    int32 min_value = 1 [(max).value = "max_value"]; // using optional `this.` prefix is also desired.
    int32 max_value = 2;
}
message NumberGenerated {
    int32 number = 1 [(min).value = "range.min_value", (max).value = "range.max_value"];
    Range range = 2 [(required) = true];
}
@alexander-yevsyukov
Copy link
Collaborator Author

I've just tested it with NumberGenerated in a testFixtures of core-java project. We don't handle this case yet. No code is generated.

@alexander-yevsyukov alexander-yevsyukov added enhancement New feature or request and removed question labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant