File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99
1010def policy_schema (common_definitions ):
11- print ("Generating policy schema" )
11+ """
12+ Create the schema for the Policy endpoint.
13+ """
14+ # load schema template and insert definitions
15+ schema = common .load_json ("./templates/policy/policy.json" )
16+ schema ["definitions" ] = {
17+ "version" : common_definitions ["version" ]
18+ }
19+
20+ # verify and return
21+ return common .check_schema (schema )
1222
1323
1424def schema_generators ():
Original file line number Diff line number Diff line change 55 "type" : " object" ,
66 "definitions" : {},
77 "required" : [
8+ " data" ,
9+ " version"
810 ],
911 "properties" : {
12+ "data" : {
13+ "$id" : " #/properties/data" ,
14+ "type" : " object" ,
15+ "description" : " The data records in this payload" ,
16+ "required" : [
17+ " policy"
18+ ],
19+ "properties" : {
20+ "policy" : {
21+ "$id" : " #/properties/data/properties/policy" ,
22+ "type" : " array" ,
23+ "title" : " The policy payload" ,
24+ "items" : {
25+ "$id" : " #/properties/data/properties/policy/items" ,
26+ "type" : " object" ,
27+ "title" : " The policy item schema" ,
28+ "additionalItems" : false ,
29+ "required" : [],
30+ "properties" : {}
31+ }
32+ }
33+ },
34+ "additionalProperties" : false
35+ },
36+ "version" : {
37+ "$id" : " #/properties/version" ,
38+ "$ref" : " #/definitions/version"
39+ }
1040 },
1141 "additionalProperties" : false
1242}
You can’t perform that action at this time.
0 commit comments