-
Notifications
You must be signed in to change notification settings - Fork 275
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 support for #validate=true to message refs #2633
Conversation
Not quite sure where/how to write tests that depend on protovalidate. I see
|
internal.WithSingleFormat(formatBinpb), | ||
internal.WithSingleFormat( | ||
formatBin, | ||
internal.WithSingleCustomOptionKey(validateKey), |
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.
Validate shouldn't be on anything except yaml right?
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.
You can validate any message, after it has been decoded. protoyaml
just provide better errors if you give it the validator directly.
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.
got it
So it can be used with the convert command, for example:
buf convert ../protoyaml-go/internal/proto --type buf.protoyaml.test.v1.ValidateTest --from ../protoyaml-go/internal/testdata/validate.validate.yaml#validate=true
outputs: