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

Validating unique prop value within array? #998

Closed
RoxKilly opened this issue Oct 18, 2023 · 2 comments
Closed

Validating unique prop value within array? #998

RoxKilly opened this issue Oct 18, 2023 · 2 comments

Comments

@RoxKilly
Copy link

Suppose I have an array of messages with field id. How can I validate uniqueness within the array?

message Student {
  string id = 1;
}

message Class {
  repeated Student students = 1; // Possible to validate unique ids?
}
@RoxKilly
Copy link
Author

Cross-posted in protovalidate (just discovered it). Feel free to close this if that project is likely the better place to solve this problem.

@rodaine
Copy link
Member

rodaine commented Oct 30, 2023

Correct, this is not possible in PGV, but can likely be handled via a CEL expression in protovalidate.

@rodaine rodaine closed this as completed Oct 30, 2023
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

2 participants