From b8e8032e6d1f4ece3342cf4c0f547cc59cd7fd13 Mon Sep 17 00:00:00 2001 From: Timo Stamm Date: Wed, 23 Sep 2026 19:22:33 +0200 Subject: [PATCH] Clarify that bytes.uuid checks length only --- proto/protovalidate/buf/validate/validate.proto | 10 ++++++---- tools/internal/gen/buf/validate/validate.pb.go | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/proto/protovalidate/buf/validate/validate.proto b/proto/protovalidate/buf/validate/validate.proto index 0ad730c4..f7ef4383 100644 --- a/proto/protovalidate/buf/validate/validate.proto +++ b/proto/protovalidate/buf/validate/validate.proto @@ -4124,10 +4124,12 @@ message BytesRules { } ]; - // `uuid` ensures that the field value encodes 128-bit UUID data as defined - // by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). - // The field must contain exactly 16 bytes representing the UUID. If the - // field value isn't a valid UUID, an error message will be generated. + // `uuid` ensures that the field `value` is exactly 16 bytes long, + // the size of a UUID in binary form as defined by + // [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#section-4). + // Only the length is enforced: the version and variant fields + // are not checked, and any 16 bytes are accepted. + // If the field value doesn't meet this rule, an error message is generated. // // ```proto // message MyBytes { diff --git a/tools/internal/gen/buf/validate/validate.pb.go b/tools/internal/gen/buf/validate/validate.pb.go index 33d85c00..e4de90ce 100644 --- a/tools/internal/gen/buf/validate/validate.pb.go +++ b/tools/internal/gen/buf/validate/validate.pb.go @@ -6063,10 +6063,12 @@ type BytesRules_Ipv6 struct { } type BytesRules_Uuid struct { - // `uuid` ensures that the field value encodes 128-bit UUID data as defined - // by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). - // The field must contain exactly 16 bytes representing the UUID. If the - // field value isn't a valid UUID, an error message will be generated. + // `uuid` ensures that the field `value` is exactly 16 bytes long, + // the size of a UUID in binary form as defined by + // [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#section-4). + // Only the length is enforced: the version and variant fields + // are not checked, and any 16 bytes are accepted. + // If the field value doesn't meet this rule, an error message is generated. // // ```proto //