diff --git a/draft-vasters-json-structure-core.md b/draft-vasters-json-structure-core.md index d99f3e3..d6b67e5 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,31 @@ 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}} 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 Section 7 of {{RFC4648}} + (e.g., `AK788072JD0T99OM8HJ5AH0000`). + +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