From 69e45a7ec4151a4e8d235ddb2889de9766958a59 Mon Sep 17 00:00:00 2001 From: "otoneko." Date: Tue, 22 Sep 2026 10:37:35 +0900 Subject: [PATCH 1/2] Clarify that string.uuid and string.tuuid check the shape only --- .../protovalidate/buf/validate/validate.proto | 21 ++++++++++++------- .../internal/gen/buf/validate/validate.pb.go | 21 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/proto/protovalidate/buf/validate/validate.proto b/proto/protovalidate/buf/validate/validate.proto index 3e76513e..daeced81 100644 --- a/proto/protovalidate/buf/validate/validate.proto +++ b/proto/protovalidate/buf/validate/validate.proto @@ -3476,9 +3476,13 @@ message StringRules { } ]; - // `uuid` specifies that the field value must be a valid UUID as defined by - // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the - // field value isn't a valid UUID, an error message will be generated. + // `uuid` specifies that the field value must have the textual shape of a + // UUID as defined by + // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4): 32 + // hexadecimal digits in five dash-separated groups. Only the shape is + // enforced, so that UUID versions defined in the future are not rejected: + // the version and variant fields are not checked. If the field value isn't + // shaped like a UUID, an error message will be generated. // // ```proto // message MyString { @@ -3499,10 +3503,13 @@ message StringRules { } ]; - // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as - // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes - // omitted. If the field value isn't a valid UUID without dashes, an error message - // will be generated. + // `tuuid` (trimmed UUID) specifies that the field value must have the + // textual shape of a UUID as defined by + // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4) with all + // dashes omitted: 32 hexadecimal digits. Only the shape is enforced, so + // that UUID versions defined in the future are not rejected: the version + // and variant fields are not checked. If the field value isn't shaped like + // a UUID without dashes, an error message will be generated. // // ```proto // message MyString { diff --git a/tools/internal/gen/buf/validate/validate.pb.go b/tools/internal/gen/buf/validate/validate.pb.go index d82d16fc..5efc3a38 100644 --- a/tools/internal/gen/buf/validate/validate.pb.go +++ b/tools/internal/gen/buf/validate/validate.pb.go @@ -5385,9 +5385,13 @@ type StringRules_Address struct { } type StringRules_Uuid struct { - // `uuid` specifies that the field value must be a valid UUID as defined by - // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the - // field value isn't a valid UUID, an error message will be generated. + // `uuid` specifies that the field value must have the textual shape of a + // UUID as defined by + // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4): 32 + // hexadecimal digits in five dash-separated groups. Only the shape is + // enforced, so that UUID versions defined in the future are not rejected: + // the version and variant fields are not checked. If the field value isn't + // shaped like a UUID, an error message will be generated. // // ```proto // @@ -5401,10 +5405,13 @@ type StringRules_Uuid struct { } type StringRules_Tuuid struct { - // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as - // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes - // omitted. If the field value isn't a valid UUID without dashes, an error message - // will be generated. + // `tuuid` (trimmed UUID) specifies that the field value must have the + // textual shape of a UUID as defined by + // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4) with all + // dashes omitted: 32 hexadecimal digits. Only the shape is enforced, so + // that UUID versions defined in the future are not rejected: the version + // and variant fields are not checked. If the field value isn't shaped like + // a UUID without dashes, an error message will be generated. // // ```proto // From 6890e8b76407c466c69570cfab3fb2d0728836b2 Mon Sep 17 00:00:00 2001 From: "otoneko." Date: Thu, 24 Sep 2026 01:56:38 +0900 Subject: [PATCH 2/2] Use datatracker.ietf.org links for RFC 9562 --- proto/protovalidate/buf/validate/validate.proto | 4 ++-- tools/internal/gen/buf/validate/validate.pb.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proto/protovalidate/buf/validate/validate.proto b/proto/protovalidate/buf/validate/validate.proto index daeced81..0ad730c4 100644 --- a/proto/protovalidate/buf/validate/validate.proto +++ b/proto/protovalidate/buf/validate/validate.proto @@ -3478,7 +3478,7 @@ message StringRules { // `uuid` specifies that the field value must have the textual shape of a // UUID as defined by - // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4): 32 + // [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#section-4): 32 // hexadecimal digits in five dash-separated groups. Only the shape is // enforced, so that UUID versions defined in the future are not rejected: // the version and variant fields are not checked. If the field value isn't @@ -3505,7 +3505,7 @@ message StringRules { // `tuuid` (trimmed UUID) specifies that the field value must have the // textual shape of a UUID as defined by - // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4) with all + // [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#section-4) with all // dashes omitted: 32 hexadecimal digits. Only the shape is enforced, so // that UUID versions defined in the future are not rejected: the version // and variant fields are not checked. If the field value isn't shaped like diff --git a/tools/internal/gen/buf/validate/validate.pb.go b/tools/internal/gen/buf/validate/validate.pb.go index 5efc3a38..33d85c00 100644 --- a/tools/internal/gen/buf/validate/validate.pb.go +++ b/tools/internal/gen/buf/validate/validate.pb.go @@ -5387,7 +5387,7 @@ type StringRules_Address struct { type StringRules_Uuid struct { // `uuid` specifies that the field value must have the textual shape of a // UUID as defined by - // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4): 32 + // [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#section-4): 32 // hexadecimal digits in five dash-separated groups. Only the shape is // enforced, so that UUID versions defined in the future are not rejected: // the version and variant fields are not checked. If the field value isn't @@ -5407,7 +5407,7 @@ type StringRules_Uuid struct { type StringRules_Tuuid struct { // `tuuid` (trimmed UUID) specifies that the field value must have the // textual shape of a UUID as defined by - // [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562#section-4) with all + // [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#section-4) with all // dashes omitted: 32 hexadecimal digits. Only the shape is enforced, so // that UUID versions defined in the future are not rejected: the version // and variant fields are not checked. If the field value isn't shaped like