Skip to content

Commit 51fc69c

Browse files
committed
meta data and property names constraints added, additional Items: string
1 parent 9b169be commit 51fc69c

File tree

1 file changed

+51
-8
lines changed

1 file changed

+51
-8
lines changed

test-schema.json

+51-8
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,62 @@
3333

3434
"type": "array",
3535
"minItems": 1,
36+
"uniqueItems": true,
3637
"items":{
3738
"properties": {
38-
"core": { "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", "type":"string" },
39-
"validation": { "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", "type":"string" },
40-
"ecma262": { "pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$", "type":"string" },
41-
"perl5": { "type":"string" },
42-
"quote": { "type":"string" }
39+
"core": {
40+
"description": "A section in official JSON Schema core drafts",
41+
"url": "https://json-schema.org/specification-links",
42+
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
43+
"type":"string"
44+
},
45+
"validation": {
46+
"description": "A section in official JSON Schema validation drafts",
47+
"url": "https://json-schema.org/specification-links",
48+
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
49+
"type":"string"
50+
},
51+
"ecma262": {
52+
"description": "A section in official ECMA 262 specification for defining regular expressions",
53+
"url": "https://262.ecma-international.org/",
54+
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
55+
"type":"string"
56+
},
57+
"perl5": {
58+
"description": "A section name in Perl documentation for defining regular expressions",
59+
"url": "https://perldoc.perl.org/perlre",
60+
"type":"string"
61+
},
62+
"quote": {
63+
"description": "Quote describing the test case",
64+
"type":"string"
65+
}
4366
},
4467
"patternProperties": {
45-
"^rfc\\d+$": { "pattern": "^[0-9a-zA-Z]+.([0-9a-zA-Z]+)*$", "type":"string" }
68+
"^rfc\\d+$": {
69+
"description": "A section in official RFC for the given rfc number",
70+
"url": "https://www.rfc-editor.org/",
71+
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
72+
"type":"string"
73+
},
74+
"^iso\\d+$": {
75+
"description": "A section in official ISO for the given iso number",
76+
"pattern": "^[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)*$",
77+
"type": "string"
78+
}
4679
},
47-
"additionalProperties": false,
48-
"minProperties": 1
80+
"additionalProperties": { "type": "string" },
81+
"minProperties": 1,
82+
"propertyNames": {
83+
"oneOf": [
84+
{
85+
"pattern": "^((iso)|(rfc))[0-9]+$"
86+
},
87+
{
88+
"enum": [ "core", "validation", "ecma262", "perl5", "quote" ]
89+
}
90+
]
91+
}
4992
}
5093
}
5194
},

0 commit comments

Comments
 (0)