-
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 structured field and rule paths to Violation #265
base: main
Are you sure you want to change the base?
Conversation
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
I finished adding |
… jchadwick/add-rule-path
This PR introduces a new structured field path format, and uses it to provide a structured path to the field and rule of a violation.
buf.validate.FieldPathElement
is added.repeated_field[1]
buf.validate.FieldPath
is added. It just contains a repeated field ofbuf.validate.FieldPathElement
repeated buf.validate.FieldPathElement
anywhere a path is needed to save a level of pointer chasing, but it is inconvenient for certain uses, e.g. comparing paths withproto.Equal
.buf.validate.Violation
fields are added:field
andrule
, both of typebuf.validate.FieldPath
. The oldfield_path
field is left for now, but deprecated.Note that there are a number of very subtle edge cases:
FieldConstraints
message. (In other cases,constraint_id
is always sufficient anyways, but we can change this behavior later.)