Skip to content

Commit 59ace40

Browse files
committed
elevate the main policy object to definitions
1 parent 756c169 commit 59ace40

1 file changed

Lines changed: 53 additions & 48 deletions

File tree

schema/templates/policy/policy.json

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,61 @@
44
"title": "The MDS Policy Schema",
55
"type": "object",
66
"definitions": {
7+
"policy": {
8+
"$id": "#/definitions/policy",
9+
"type": "object",
10+
"title": "The policy object schema",
11+
"additionalItems": false,
12+
"required": [
13+
"name",
14+
"policy_id",
15+
"description",
16+
"start_date",
17+
"published_date",
18+
"rules"
19+
],
20+
"properties": {
21+
"name": {
22+
"$id": "#/definitions/policy/properties/name",
23+
"$ref": "#/definitions/string",
24+
"description": "Name of policy"
25+
},
26+
"policy_id": {
27+
"$id": "#/definitions/policy/properties/policy_id",
28+
"$ref": "#/definitions/uuid",
29+
"description": "Unique ID of policy"
30+
},
31+
"description": {
32+
"$id": "#/definitions/policy/properties/description",
33+
"$ref": "#/definitions/string",
34+
"description": "Description of policy"
35+
},
36+
"start_date":{
37+
"$id": "#/definitions/policy/properties/start_date",
38+
"$ref": "#/definitions/timestamp",
39+
"description": "Beginning date/time of policy enforcement"
40+
},
41+
"published_date": {
42+
"$id": "#/definitions/policy/properties/published_date",
43+
"$ref": "#/definitions/timestamp",
44+
"description": "Timestamp at which the policy was published"
45+
},
46+
"rules": {
47+
"$id": "#/definitions/rule",
48+
"type": "array",
49+
"description": "List of applicable Rule objects",
50+
"items": {
51+
"$id": "#/definitions/policy/properties/rules/items",
52+
"$ref": "#/definitions/rule"
53+
},
54+
"minItems": 1
55+
}
56+
}
57+
},
758
"rule": {
859
"$id": "#/definitions/rule",
960
"type": "object",
61+
"description": "An individual rule in a policy",
1062
"additionalProperties": false,
1163
"required": [],
1264
"properties": {}
@@ -32,54 +84,7 @@
3284
"title": "The policy payload",
3385
"items": {
3486
"$id": "#/properties/data/properties/policy/items",
35-
"type": "object",
36-
"title": "The policy item schema",
37-
"additionalItems": false,
38-
"required": [
39-
"name",
40-
"policy_id",
41-
"description",
42-
"start_date",
43-
"published_date",
44-
"rules"
45-
],
46-
"properties": {
47-
"name": {
48-
"$id": "#/properties/data/properties/policy/items/properties/name",
49-
"$ref": "#/definitions/string",
50-
"description": "Name of policy"
51-
},
52-
"policy_id": {
53-
"$id": "#/properties/data/properties/policy/items/properties/policy_id",
54-
"$ref": "#/definitions/uuid",
55-
"description": "Unique ID of policy"
56-
},
57-
"description": {
58-
"$id": "#/properties/data/properties/policy/items/properties/description",
59-
"$ref": "#/definitions/string",
60-
"description": "Description of policy"
61-
},
62-
"start_date":{
63-
"$id": "#/properties/data/properties/policy/items/properties/start_date",
64-
"$ref": "#/definitions/timestamp",
65-
"description": "Beginning date/time of policy enforcement"
66-
},
67-
"published_date": {
68-
"$id": "#/properties/data/properties/policy/items/properties/published_date",
69-
"$ref": "#/definitions/timestamp",
70-
"description": "Timestamp that the policy was published"
71-
},
72-
"rules": {
73-
"$id": "#/properties/data/properties/policy/items/properties/rules",
74-
"type": "array",
75-
"description": "List of applicable Rule objects",
76-
"items": {
77-
"$id": "#/properties/data/properties/policy/items/properties/rules/items",
78-
"$ref": "#/definitions/rule",
79-
"description": "An individual rule in the policy"
80-
}
81-
}
82-
}
87+
"$ref": "#/definitions/policy"
8388
}
8489
}
8590
},

0 commit comments

Comments
 (0)