-
Notifications
You must be signed in to change notification settings - Fork 582
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
repeated field validation along with item specific validations #251
Comments
Your first try is mostly right, just a small syntax error. Try this instead: message One {
repeated string str = 1 [(validate.rules).repeated = {
unique: true
min_items: 1
items: {
string: {
min_len: 3
max_len: 10
}
}
}];
} |
Yes, my bad. I missed the basic syntax. Thanks @akonradi |
I think you'll also need to use the expanded syntax to set more than one field. Try this: message Three {
repeated string str = 1 [(validate.rules).repeated = {
unique: true
min_items: 1
}];
} |
Means, the plugin does not handle more than one options in the proto-options-array |
This is a limitation of the protoc parser it turns out; you're essentially creating a new |
I think it is the limitation in It turns out that in the case of I have opened an issue in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi, I want to check the
unique
andmin_items
validations along with the corresponding item validation in GoLang, but in doing so, I am getting an error:using:
And using something like passing more than one options for a field, I am getting another error:
using:
Also, passing more than one validate field options in the array only uses the last one only.
For object Three, only
min_items
validation will be generated.Am I missing something or are these bugs?
The text was updated successfully, but these errors were encountered: