Skip to content

Commit

Permalink
Also remove Violation
Browse files Browse the repository at this point in the history
  • Loading branch information
jchadwick-buf committed Oct 16, 2024
1 parent 2225731 commit 65dcafc
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 220 deletions.
29 changes: 0 additions & 29 deletions proto/protovalidate/buf/validate/validate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4748,32 +4748,3 @@ message TimestampRules {
// [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md
extensions 1000 to max;
}

// `Violation` represents a single instance where a validation rule, expressed
// as a `Constraint`, was not met. It provides information about the field that
// caused the violation, the specific constraint that wasn't fulfilled, and a
// human-readable error message.
//
// ```json
// {
// "fieldPath": "bar",
// "constraintId": "foo.bar",
// "message": "bar must be greater than 0"
// }
// ```
message Violation {
// `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
// This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
optional string field_path = 1;

// `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
// This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
optional string constraint_id = 2;

// `message` is a human-readable error message that describes the nature of the violation.
// This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
optional string message = 3;

// `for_key` indicates whether the violation was caused by a map key, rather than a value.
optional bool for_key = 4;
}
Loading

0 comments on commit 65dcafc

Please sign in to comment.