File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
content/2020-12/validation Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -61,4 +61,20 @@ The `maxLength` keyword is used to specify the maximum length of a string instan
61
61
62
62
{{<instance-pass ` An instance with a numeric value is valid ` >}}
63
63
55
64
- {{</instance-pass >}}
64
+ {{</instance-pass >}}
65
+
66
+ {{<schema ` Schema for maximum string length validation with unicode characters ` >}}
67
+ {
68
+ "$schema": "https://json-schema.org/draft/2020-12/schema ",
69
+ "type": "string",
70
+ "maxLength": 3
71
+ }
72
+ {{</schema >}}
73
+
74
+ {{<instance-pass ` An instance with 3 or less characters is valid ` >}}
75
+ "\u0066\u006F\u006F" // --> "foo"
76
+ {{</instance-pass >}}
77
+
78
+ {{<instance-fail ` An instance with more than 3 characters is invalid ` >}}
79
+ "\u0048\u0065\u006C\u006C\u006F" // --> 'Hello'
80
+ {{</instance-fail >}}
You can’t perform that action at this time.
0 commit comments