File tree Expand file tree Collapse file tree 3 files changed +177
-0
lines changed Expand file tree Collapse file tree 3 files changed +177
-0
lines changed Original file line number Diff line number Diff line change 43
43
}
44
44
]
45
45
},
46
+ {
47
+ "description" : " propertyNames validation with pattern for camelCase" ,
48
+ "schema" : {
49
+ "propertyNames" : { "pattern" : " ^[a-z]+([A-Z][a-z]+)*$" }
50
+ },
51
+ "tests" : [
52
+ {
53
+ "description" : " all property names valid" ,
54
+ "data" : {
55
+ "f" : {},
56
+ "foo" : {},
57
+ "foobar" : {},
58
+ "fooBar" : {}
59
+ },
60
+ "valid" : true
61
+ },
62
+ {
63
+ "description" : " property name with leading capital letter is invalid" ,
64
+ "data" : {
65
+ "Foo" : {}
66
+ },
67
+ "valid" : false
68
+ },
69
+ {
70
+ "description" : " property name with adjacent capital letters is invalid" ,
71
+ "data" : {
72
+ "fOO" : {}
73
+ },
74
+ "valid" : false
75
+ },
76
+ {
77
+ "description" : " property name with digit is invalid" ,
78
+ "data" : {
79
+ "foo1" : {}
80
+ },
81
+ "valid" : false
82
+ },
83
+ {
84
+ "description" : " object without properties is valid" ,
85
+ "data" : {},
86
+ "valid" : true
87
+ },
88
+ {
89
+ "description" : " ignores arrays" ,
90
+ "data" : [1 , 2 , 3 , 4 ],
91
+ "valid" : true
92
+ },
93
+ {
94
+ "description" : " ignores strings" ,
95
+ "data" : " foobar" ,
96
+ "valid" : true
97
+ },
98
+ {
99
+ "description" : " ignores other non-objects" ,
100
+ "data" : 12 ,
101
+ "valid" : true
102
+ }
103
+ ]
104
+ },
46
105
{
47
106
"description" : " propertyNames with boolean schema true" ,
48
107
"schema" : {"propertyNames" : true },
Original file line number Diff line number Diff line change 43
43
}
44
44
]
45
45
},
46
+ {
47
+ "description" : " propertyNames validation with pattern for camelCase" ,
48
+ "schema" : {
49
+ "propertyNames" : { "pattern" : " ^[a-z]+([A-Z][a-z]+)*$" }
50
+ },
51
+ "tests" : [
52
+ {
53
+ "description" : " all property names valid" ,
54
+ "data" : {
55
+ "f" : {},
56
+ "foo" : {},
57
+ "foobar" : {},
58
+ "fooBar" : {}
59
+ },
60
+ "valid" : true
61
+ },
62
+ {
63
+ "description" : " property name with leading capital letter is invalid" ,
64
+ "data" : {
65
+ "Foo" : {}
66
+ },
67
+ "valid" : false
68
+ },
69
+ {
70
+ "description" : " property name with adjacent capital letters is invalid" ,
71
+ "data" : {
72
+ "fOO" : {}
73
+ },
74
+ "valid" : false
75
+ },
76
+ {
77
+ "description" : " property name with digit is invalid" ,
78
+ "data" : {
79
+ "foo1" : {}
80
+ },
81
+ "valid" : false
82
+ },
83
+ {
84
+ "description" : " object without properties is valid" ,
85
+ "data" : {},
86
+ "valid" : true
87
+ },
88
+ {
89
+ "description" : " ignores arrays" ,
90
+ "data" : [1 , 2 , 3 , 4 ],
91
+ "valid" : true
92
+ },
93
+ {
94
+ "description" : " ignores strings" ,
95
+ "data" : " foobar" ,
96
+ "valid" : true
97
+ },
98
+ {
99
+ "description" : " ignores other non-objects" ,
100
+ "data" : 12 ,
101
+ "valid" : true
102
+ }
103
+ ]
104
+ },
46
105
{
47
106
"description" : " propertyNames with boolean schema true" ,
48
107
"schema" : {"propertyNames" : true },
Original file line number Diff line number Diff line change 43
43
}
44
44
]
45
45
},
46
+ {
47
+ "description" : " propertyNames validation with pattern for camelCase" ,
48
+ "schema" : {
49
+ "propertyNames" : { "pattern" : " ^[a-z]+([A-Z][a-z]+)*$" }
50
+ },
51
+ "tests" : [
52
+ {
53
+ "description" : " all property names valid" ,
54
+ "data" : {
55
+ "f" : {},
56
+ "foo" : {},
57
+ "foobar" : {},
58
+ "fooBar" : {}
59
+ },
60
+ "valid" : true
61
+ },
62
+ {
63
+ "description" : " property name with leading capital letter is invalid" ,
64
+ "data" : {
65
+ "Foo" : {}
66
+ },
67
+ "valid" : false
68
+ },
69
+ {
70
+ "description" : " property name with adjacent capital letters is invalid" ,
71
+ "data" : {
72
+ "fOO" : {}
73
+ },
74
+ "valid" : false
75
+ },
76
+ {
77
+ "description" : " property name with digit is invalid" ,
78
+ "data" : {
79
+ "foo1" : {}
80
+ },
81
+ "valid" : false
82
+ },
83
+ {
84
+ "description" : " object without properties is valid" ,
85
+ "data" : {},
86
+ "valid" : true
87
+ },
88
+ {
89
+ "description" : " ignores arrays" ,
90
+ "data" : [1 , 2 , 3 , 4 ],
91
+ "valid" : true
92
+ },
93
+ {
94
+ "description" : " ignores strings" ,
95
+ "data" : " foobar" ,
96
+ "valid" : true
97
+ },
98
+ {
99
+ "description" : " ignores other non-objects" ,
100
+ "data" : 12 ,
101
+ "valid" : true
102
+ }
103
+ ]
104
+ },
46
105
{
47
106
"description" : " propertyNames with boolean schema true" ,
48
107
"schema" : {"propertyNames" : true },
You can’t perform that action at this time.
0 commit comments