-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add example options for most types #239
Conversation
The cleanest noop is not setting anything, but yeah a CEL expression of true is probably the easiest (though I know protovalidate-go will optimize it all away). |
@rodaine I noticed the CI is failing. I've also had issues with CI with a pull request against the buf repo. Is it because the PR is not from someone on the buf org or something?
|
Yeah I think so. Letting the team know about it. Might just be a configuration issue. |
Fix in flight: bufbuild/buf-action#64 |
@rodaine oh, right. It got to the next error. I was wondering if I should check in changes to |
Oh man it looks like you hit a bunch of landmines. One sec while I update golangci-lint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @sudorandom!
This PR adds an example field for many types. Examples are no-op constraints that allow you to declare what an example value for each field may look like. These values SHOULD match the other constraints. It's planned that a
buf lint
rule will check these values to see if they do, in fact, validate given the other constraints on the field. Here are the types that this was added to:All fields are
repeatable
, to allow for multiple examples. I'm unsure if there is a better way to have a no-op constraint other thanexpression: "true"
, so please let me know if I can just excludeexpression
altogether or if there is another way to do that. This resolves #237.