You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2801,24 +2801,32 @@ Possible validation errors: [`string.email`](#stringemail)
2801
2801
2802
2802
Requires the string value to be a valid GUID.
2803
2803
2804
-
-`options` - optional settings:
2805
-
-`version` - specifies one or more acceptable versions. Can be an Array or String with the following values:
2806
-
`uuidv1`, `uuidv2`, `uuidv3`, `uuidv4`, `uuidv5`, `uuidv6`, `uuidv7` or `uuidv8`. If no `version` is specified then it is assumed to be a generic `guid`
2807
-
which will not validate the version or variant of the guid and just check for general structure format.
2808
-
-`separator` - defines the allowed or required GUID separator where:
2809
-
-`true` - a separator is required, can be either `:` or `-`.
2810
-
-`false` - separator is not allowed.
2811
-
-`'-'` - a dash separator is required.
2812
-
-`':'` - a colon separator is required.
2813
-
- defaults to optional `:` or `-` separator.
2804
+
-`options` - optional settings:
2805
+
-`version` - specifies one or more acceptable versions. Can be an Array or String with the following values:
2806
+
`uuidv1`, `uuidv2`, `uuidv3`, `uuidv4`, `uuidv5`, `uuidv6`, `uuidv7` or `uuidv8`. If no `version` is specified then it is assumed to be a generic `guid`
2807
+
which will not validate the version or variant of the guid and just check for general structure format.
2808
+
-`separator` - defines the allowed or required GUID separator where:
2809
+
-`true` - a separator is required, can be either `:` or `-`.
2810
+
-`false` - separator is not allowed.
2811
+
-`'-'` - a dash separator is required.
2812
+
-`':'` - a colon separator is required.
2813
+
- defaults to optional `:` or `-` separator.
2814
+
-`wrapper` - defines the allowed or required GUID wrapper characters where:
2815
+
-`undefined` - (default) the GUID can be optionally wrapped with `{}`, `[]`, or `()`. The opening and closing characters must be a matching pair.
2816
+
-`true` - the GUID must be wrapped with `{}`, `[]`, or `()`. The opening and closing characters must be a matching pair.
2817
+
-`false` - wrapper characters are not allowed.
2818
+
-`'['`, `'{'`, or `'('` - a specific wrapper is required (e.g., if `wrapper` is `'['`, the GUID must be enclosed in square brackets).
2819
+
2814
2820
2815
2821
```js
2816
2822
constschema=Joi.string().guid({
2817
2823
version: [
2818
2824
'uuidv4',
2819
2825
'uuidv5'
2820
-
]
2826
+
],
2827
+
wrapper:false
2821
2828
});
2829
+
2822
2830
```
2823
2831
2824
2832
Possible validation errors: [`string.guid`](#stringguid)
0 commit comments