From 603051f0f4203424c95caf910c87ed85fe6e2a27 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Sat, 29 Nov 2025 16:34:10 +0100 Subject: [PATCH 1/6] Add uuidEncoding keyword for UUID encoding format selection This adds a new 'uuidEncoding' type annotation keyword for the 'uuid' type that allows specifying alternate UUID encoding formats: - rfc9562: Standard RFC 9562 UUID format (default) - base32hex: 26-character unpadded base32hex encoding (RFC 4648) - base64: Base64 encoding (RFC 4648) - base64url: Base64url encoding (RFC 4648) Fixes #14 --- draft-vasters-json-structure-core.md | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index d99f3e3..fa9c369 100644 --- a/draft-vasters-json-structure-core.md +++ b/draft-vasters-json-structure-core.md @@ -482,7 +482,8 @@ A universally unique identifier. - Base type: `string` - Constraints: - - The string value MUST conform to the {{RFC9562}} `UUID` format. + - The string value MUST conform to the {{RFC9562}} `UUID` format, or to an + alternate encoding specified by the `uuidEncoding` keyword. #### `uri` {#uri} @@ -1443,6 +1444,33 @@ types to constrain the fractional part. } ~~~ +### The `uuidEncoding` Keyword {#uuidencoding-keyword} + +Specifies the encoding format for a UUID value. The `uuidEncoding` keyword is +used as an annotation for `uuid` types. + +The permitted values for `uuidEncoding` are: + +- `rfc9562`: The UUID value is encoded in the standard {{RFC9562}} format + (e.g., `550e8400-e29b-41d4-a716-446655440000`). This is the default. +- `base32hex`: The UUID value is encoded as a 26-character unpadded base32hex + string as defined in {{RFC4648}}. +- `base64`: The UUID value is encoded as a base64 string as defined in + {{RFC4648}}. +- `base64url`: The UUID value is encoded as a base64url string as defined in + {{RFC4648}}. + +If `uuidEncoding` is not specified, the default encoding is `rfc9562`. + +**Example**: + +~~~ json +{ + "type": "uuid", + "uuidEncoding": "base32hex" +} +~~~ + ### The `contentEncoding` Keyword {#contentencoding-keyword} Specifies the encoding of a binary value. The `contentEncoding` keyword is used From 7aa8607ed9aeba13ae7945cced07fe44aed21d52 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Sat, 29 Nov 2025 16:35:34 +0100 Subject: [PATCH 2/6] Add inline examples for each UUID encoding format --- draft-vasters-json-structure-core.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index fa9c369..70435d2 100644 --- a/draft-vasters-json-structure-core.md +++ b/draft-vasters-json-structure-core.md @@ -1454,11 +1454,11 @@ The permitted values for `uuidEncoding` are: - `rfc9562`: The UUID value is encoded in the standard {{RFC9562}} format (e.g., `550e8400-e29b-41d4-a716-446655440000`). This is the default. - `base32hex`: The UUID value is encoded as a 26-character unpadded base32hex - string as defined in {{RFC4648}}. + string as defined in {{RFC4648}} (e.g., `AHO84039NASJ54B68SL50G0000`). - `base64`: The UUID value is encoded as a base64 string as defined in - {{RFC4648}}. + {{RFC4648}} (e.g., `VQ6EAOKbQdSnFkRmVUQAAA==`). - `base64url`: The UUID value is encoded as a base64url string as defined in - {{RFC4648}}. + {{RFC4648}} (e.g., `VQ6EAOKbQdSnFkRmVUQAAA`). If `uuidEncoding` is not specified, the default encoding is `rfc9562`. From a1116ffff4403301045a33a68829e2d0ce51047e Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Sat, 29 Nov 2025 16:39:31 +0100 Subject: [PATCH 3/6] Replace base64/base64url with base64sort/base52sort encodings These encodings are being considered for inclusion in RFC 9562. --- draft-vasters-json-structure-core.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index 70435d2..909c45a 100644 --- a/draft-vasters-json-structure-core.md +++ b/draft-vasters-json-structure-core.md @@ -1455,10 +1455,10 @@ The permitted values for `uuidEncoding` are: (e.g., `550e8400-e29b-41d4-a716-446655440000`). This is the default. - `base32hex`: The UUID value is encoded as a 26-character unpadded base32hex string as defined in {{RFC4648}} (e.g., `AHO84039NASJ54B68SL50G0000`). -- `base64`: The UUID value is encoded as a base64 string as defined in - {{RFC4648}} (e.g., `VQ6EAOKbQdSnFkRmVUQAAA==`). -- `base64url`: The UUID value is encoded as a base64url string as defined in - {{RFC4648}} (e.g., `VQ6EAOKbQdSnFkRmVUQAAA`). +- `base64sort`: The UUID value is encoded as a 22-character base64 sortable + string (e.g., `VQ6EAOKbQdSnFkRmVUQAAA`). +- `base52sort`: The UUID value is encoded as a 24-character base52 sortable + string using only letters (e.g., `fRmqMmvCPbxNTgzKHZWdkD`). If `uuidEncoding` is not specified, the default encoding is `rfc9562`. @@ -1467,7 +1467,7 @@ If `uuidEncoding` is not specified, the default encoding is `rfc9562`. ~~~ json { "type": "uuid", - "uuidEncoding": "base32hex" + "uuidEncoding": "base64sort" } ~~~ From 1df35584a2104d907378a7fc477ef1b87163ccc4 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Sat, 29 Nov 2025 16:40:55 +0100 Subject: [PATCH 4/6] Use consistent UUID examples across all encodings All encoding examples now use the same UUID: 550e8400-e29b-41d4-a716-446655440000 --- draft-vasters-json-structure-core.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index 909c45a..9094a14 100644 --- a/draft-vasters-json-structure-core.md +++ b/draft-vasters-json-structure-core.md @@ -1454,11 +1454,11 @@ The permitted values for `uuidEncoding` are: - `rfc9562`: The UUID value is encoded in the standard {{RFC9562}} format (e.g., `550e8400-e29b-41d4-a716-446655440000`). This is the default. - `base32hex`: The UUID value is encoded as a 26-character unpadded base32hex - string as defined in {{RFC4648}} (e.g., `AHO84039NASJ54B68SL50G0000`). + string as defined in {{RFC4648}} (e.g., `AK788072JD0T99OM8HJ5AH0000`). - `base64sort`: The UUID value is encoded as a 22-character base64 sortable - string (e.g., `VQ6EAOKbQdSnFkRmVUQAAA`). -- `base52sort`: The UUID value is encoded as a 24-character base52 sortable - string using only letters (e.g., `fRmqMmvCPbxNTgzKHZWdkD`). + string (e.g., `KFu3-D9QFSHb4ZGaKJF---`). +- `base52sort`: The UUID value is encoded as a 23-character base52 sortable + string using only letters (e.g., `CACeYFbTsBxqTXPqHtHTGBx`). If `uuidEncoding` is not specified, the default encoding is `rfc9562`. From 74fe3509bc07a6195b5b5313ea984ca1e92cc0a7 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Sat, 29 Nov 2025 16:42:04 +0100 Subject: [PATCH 5/6] Add cross-references and encoding details for UUID formats - Added RFC references for rfc9562 and base32hex (RFC4648 Section 7) - Added alphabet specification for base64sort - Noted that base64sort and base52sort are under consideration for RFC 9562 revision - Clarified that rfc9562 uses hexadecimal format with dashes --- draft-vasters-json-structure-core.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index 9094a14..55f7877 100644 --- a/draft-vasters-json-structure-core.md +++ b/draft-vasters-json-structure-core.md @@ -1451,14 +1451,21 @@ used as an annotation for `uuid` types. The permitted values for `uuidEncoding` are: -- `rfc9562`: The UUID value is encoded in the standard {{RFC9562}} format - (e.g., `550e8400-e29b-41d4-a716-446655440000`). This is the default. +- `rfc9562`: The UUID value is encoded in the standard {{RFC9562}} hexadecimal + format with dashes (e.g., `550e8400-e29b-41d4-a716-446655440000`). This is the + default. - `base32hex`: The UUID value is encoded as a 26-character unpadded base32hex - string as defined in {{RFC4648}} (e.g., `AK788072JD0T99OM8HJ5AH0000`). -- `base64sort`: The UUID value is encoded as a 22-character base64 sortable - string (e.g., `KFu3-D9QFSHb4ZGaKJF---`). -- `base52sort`: The UUID value is encoded as a 23-character base52 sortable - string using only letters (e.g., `CACeYFbTsBxqTXPqHtHTGBx`). + string as defined in Section 7 of {{RFC4648}} + (e.g., `AK788072JD0T99OM8HJ5AH0000`). +- `base64sort`: The UUID value is encoded as a 22-character lexicographically + sortable base64 string using the alphabet + `-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz` + (e.g., `KFu3-D9QFSHb4ZGaKJF---`). This encoding is under consideration for + inclusion in a future revision of {{RFC9562}}. +- `base52sort`: The UUID value is encoded as a 23-character lexicographically + sortable base52 string using only alphabetic characters + (e.g., `CACeYFbTsBxqTXPqHtHTGBx`). This encoding is under consideration for + inclusion in a future revision of {{RFC9562}}. If `uuidEncoding` is not specified, the default encoding is `rfc9562`. From 2fda3ba92773dc23b18920967252e6a07aa924d4 Mon Sep 17 00:00:00 2001 From: Clemens Vasters Date: Sat, 29 Nov 2025 16:44:48 +0100 Subject: [PATCH 6/6] Remove base64sort and base52sort encodings Only include encodings explicitly defined in RFC 9562 and RFC 4648: - rfc9562: Standard hexadecimal format with dashes - base32hex: 26-character unpadded base32hex (RFC 4648 Section 7) --- draft-vasters-json-structure-core.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index 55f7877..d6b67e5 100644 --- a/draft-vasters-json-structure-core.md +++ b/draft-vasters-json-structure-core.md @@ -1457,15 +1457,6 @@ The permitted values for `uuidEncoding` are: - `base32hex`: The UUID value is encoded as a 26-character unpadded base32hex string as defined in Section 7 of {{RFC4648}} (e.g., `AK788072JD0T99OM8HJ5AH0000`). -- `base64sort`: The UUID value is encoded as a 22-character lexicographically - sortable base64 string using the alphabet - `-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz` - (e.g., `KFu3-D9QFSHb4ZGaKJF---`). This encoding is under consideration for - inclusion in a future revision of {{RFC9562}}. -- `base52sort`: The UUID value is encoded as a 23-character lexicographically - sortable base52 string using only alphabetic characters - (e.g., `CACeYFbTsBxqTXPqHtHTGBx`). This encoding is under consideration for - inclusion in a future revision of {{RFC9562}}. If `uuidEncoding` is not specified, the default encoding is `rfc9562`. @@ -1474,7 +1465,7 @@ If `uuidEncoding` is not specified, the default encoding is `rfc9562`. ~~~ json { "type": "uuid", - "uuidEncoding": "base64sort" + "uuidEncoding": "base32hex" } ~~~