File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6161 "valid" : true
6262 }
6363 ]
64+ },
65+ {
66+ "description" : " pattern with Unicode property escape requires unicode mode" ,
67+ "schema" : {
68+ "$schema" : " https://json-schema.org/draft/2020-12/schema" ,
69+ "type" : " string" ,
70+ "pattern" : " ^\\ p{Letter}+$"
71+ },
72+ "tests" : [
73+ {
74+ "description" : " ASCII letters match" ,
75+ "data" : " Hello" ,
76+ "valid" : true
77+ },
78+ {
79+ "description" : " Non-ASCII letters match" ,
80+ "data" : " π" ,
81+ "valid" : true
82+ },
83+ {
84+ "description" : " Digits do not match" ,
85+ "data" : " 123" ,
86+ "valid" : false
87+ }
88+ ]
6489 }
6590]
Original file line number Diff line number Diff line change 172172 "valid" : true
173173 }
174174 ]
175+ },
176+ {
177+ "description" : " patternProperties with Unicode property escape" ,
178+ "schema" : {
179+ "$schema" : " https://json-schema.org/draft/2020-12/schema" ,
180+ "type" : " object" ,
181+ "patternProperties" : {
182+ "^\\ p{Letter}+$" : {
183+ "type" : " number"
184+ }
185+ }
186+ },
187+ "tests" : [
188+ {
189+ "description" : " Unicode letter property name matches" ,
190+ "data" : {
191+ "π" : 1
192+ },
193+ "valid" : true
194+ },
195+ {
196+ "description" : " Non-letter property name does not match pattern" ,
197+ "data" : {
198+ "123" : 1
199+ },
200+ "valid" : true
201+ }
202+ ]
175203 }
176204]
Original file line number Diff line number Diff line change 6161 "valid" : true
6262 }
6363 ]
64+ },
65+ {
66+ "description" : " pattern with Unicode property escape" ,
67+ "schema" : {
68+ "$schema" : " https://json-schema.org/v1" ,
69+ "type" : " string" ,
70+ "pattern" : " ^\\ p{Letter}+$"
71+ },
72+ "tests" : [
73+ {
74+ "description" : " a valid case with a Unicode letter" ,
75+ "data" : " π" ,
76+ "valid" : true
77+ },
78+ {
79+ "description" : " another valid case with multiple Unicode letters" ,
80+ "data" : " πλ" ,
81+ "valid" : true
82+ },
83+ {
84+ "description" : " an invalid case where the string contains digits" ,
85+ "data" : " 123" ,
86+ "valid" : false
87+ }
88+ ]
6489 }
6590]
Original file line number Diff line number Diff line change 172172 "valid" : true
173173 }
174174 ]
175+ },
176+ {
177+ "description" : " patternProperties with Unicode property escape" ,
178+ "schema" : {
179+ "$schema" : " https://json-schema.org/v1" ,
180+ "type" : " object" ,
181+ "patternProperties" : {
182+ "^\\ p{Letter}+$" : {"type" : " number" }
183+ }
184+ },
185+ "tests" : [
186+ {
187+ "description" : " Unicode letter property name matches" ,
188+ "data" : {"π" : 1 },
189+ "valid" : true
190+ },
191+ {
192+ "description" : " Unicode letter property name matches but value type is incorrect" ,
193+ "data" : {"π" : " 1" },
194+ "valid" : false
195+ },
196+ {
197+ "description" : " Non-letter property name does not match pattern" ,
198+ "data" : {"123" : 1 },
199+ "valid" : true
200+ }
201+ ]
175202 }
176203]
You can’t perform that action at this time.
0 commit comments