|
1 | 1 | { |
2 | 2 | "$schema": "http://json-schema.org/draft-07/schema#", |
3 | 3 |
|
4 | | - "type": "object", |
5 | | - "title": "Architecture configuration", |
6 | | - "required": ["$schema", "kind", "type", "name", "description"], |
7 | | - "allOf": [ |
8 | | - { |
9 | | - "if": { |
10 | | - "properties": { |
11 | | - "type": { "const": "fully configured" } |
12 | | - } |
13 | | - }, |
14 | | - "then": { |
15 | | - "required": ["implemented_extensions", "params"], |
16 | | - "properties": { |
17 | | - "params": { |
18 | | - "type": "object" |
19 | | - }, |
20 | | - "mandatory_extensions": { |
21 | | - "type": "null" |
22 | | - }, |
23 | | - "non_mandatory_extensions": { |
24 | | - "type": "null" |
25 | | - }, |
26 | | - "prohbited_extensions": { |
27 | | - "type": "null" |
28 | | - }, |
29 | | - "implemented_extensions": { |
30 | | - "description": "Extensions implemented by this architecture", |
31 | | - "type": "array", |
32 | | - "items": { |
33 | | - "type": "object", |
34 | | - "required": ["name", "version"], |
35 | | - "properties": { |
36 | | - "name": { |
37 | | - "type": "string", |
38 | | - "pattern": "^([A-WY]|([SXZ][a-z0-9]+))$", |
39 | | - "description": "Extension name" |
40 | | - }, |
41 | | - "version": { |
42 | | - "oneOf": [ |
43 | | - { |
44 | | - "type": "string", |
45 | | - "description": "Extension version" |
46 | | - }, |
47 | | - { |
48 | | - "type": "number" |
49 | | - } |
50 | | - ] |
51 | | - } |
| 4 | + "$defs": { |
| 5 | + "full_configuration": { |
| 6 | + "type": "object", |
| 7 | + "required": [ |
| 8 | + "$schema", |
| 9 | + "kind", |
| 10 | + "type", |
| 11 | + "description", |
| 12 | + "name", |
| 13 | + "implemented_extensions", |
| 14 | + "params" |
| 15 | + ], |
| 16 | + "properties": { |
| 17 | + "$schema": { |
| 18 | + "type": "string", |
| 19 | + "format": "uri-reference", |
| 20 | + "const": "config_schema.json#" |
| 21 | + }, |
| 22 | + "kind": { |
| 23 | + "type": "string", |
| 24 | + "const": "architecture configuration" |
| 25 | + }, |
| 26 | + "type": { |
| 27 | + "type": "string", |
| 28 | + "const": "fully configured" |
| 29 | + }, |
| 30 | + "name": { |
| 31 | + "type": "string", |
| 32 | + "description": "Name of the configuration" |
| 33 | + }, |
| 34 | + "description": { |
| 35 | + "type": "string", |
| 36 | + "description": "An asciidoc description of the configuration" |
| 37 | + }, |
| 38 | + "params": { |
| 39 | + "type": "object" |
| 40 | + }, |
| 41 | + "implemented_extensions": { |
| 42 | + "description": "Extensions implemented by this architecture", |
| 43 | + "type": "array", |
| 44 | + "items": { |
| 45 | + "type": "object", |
| 46 | + "required": ["name", "version"], |
| 47 | + "properties": { |
| 48 | + "name": { |
| 49 | + "$ref": "schema_defs.json#/$defs/extension_name", |
| 50 | + "description": "Extension name" |
52 | 51 | }, |
53 | | - "additionalProperties": false |
| 52 | + "version": { |
| 53 | + "$ref": "schema_defs.json#/$defs/extension_version" |
| 54 | + } |
54 | 55 | } |
55 | 56 | } |
56 | 57 | } |
57 | | - } |
58 | | - }, |
59 | | - { |
60 | | - "if": { |
61 | | - "properties": { |
62 | | - "type": { "const": "partially configured" } |
63 | | - } |
64 | 58 | }, |
65 | | - "then": { |
66 | | - "anyOf": [ |
67 | | - { |
68 | | - "required": ["mandatory_extensions"] |
69 | | - }, |
70 | | - { |
71 | | - "required": ["params"] |
72 | | - } |
73 | | - ], |
74 | | - "properties": { |
75 | | - "params": { |
76 | | - "type": "object" |
77 | | - }, |
78 | | - "mandatory_extensions": { |
79 | | - "description": "Extensions mandatory in this architecture", |
80 | | - "type": "array", |
81 | | - "items": { |
82 | | - "$ref": "schema_defs.json#/$defs/extension_requirement" |
83 | | - }, |
84 | | - "default": { |
85 | | - "const": [] |
86 | | - } |
87 | | - }, |
88 | | - "non_mandatory_extensions": { |
89 | | - "description": "Extensions that are not mandatory but are still _special_ in this architecture. This could mean different things depending on the context: for certificates or generated IP, this would correspond to _optional supported_, and extensions not in non_mandatory are not possible. For profiles, this corresponds to some type of _profile optional_, but extensions in non_mandatory are still possible.", |
90 | | - "type": "array", |
91 | | - "items": { |
92 | | - "$ref": "schema_defs.json#/$defs/extension_requirement" |
93 | | - }, |
94 | | - "default": { |
95 | | - "const": [] |
96 | | - } |
97 | | - }, |
98 | | - "prohibited_extensions": { |
99 | | - "description": "Extensions explicitly prohibited in this architecture. Does *not* need to include extensions that are excluded because of a conflict-by-definition with a mandatory extension, as those will be calculated automatically", |
100 | | - "type": "array", |
101 | | - "items": { |
102 | | - "$ref": "schema_defs.json#/$defs/extension_requirement" |
103 | | - }, |
104 | | - "default": { |
105 | | - "const": [] |
106 | | - } |
107 | | - }, |
108 | | - "implemented_extensions": { |
109 | | - "type": "null" |
110 | | - } |
111 | | - } |
112 | | - } |
| 59 | + "additionalProperties": false |
113 | 60 | }, |
114 | | - { |
115 | | - "if": { |
116 | | - "properties": { |
117 | | - "type": { "const": "unconfigured" } |
118 | | - } |
119 | | - }, |
120 | | - "then": { |
| 61 | + "partial_configuration": { |
| 62 | + "type": "object", |
| 63 | + "required": [ |
| 64 | + "$schema", |
| 65 | + "kind", |
| 66 | + "type", |
| 67 | + "name", |
| 68 | + "description", |
| 69 | + "mandatory_extensions" |
| 70 | + ], |
| 71 | + "properties": { |
| 72 | + "$schema": { |
| 73 | + "type": "string", |
| 74 | + "format": "uri-reference", |
| 75 | + "const": "config_schema.json#" |
| 76 | + }, |
| 77 | + "kind": { |
| 78 | + "type": "string", |
| 79 | + "const": "architecture configuration" |
| 80 | + }, |
| 81 | + "type": { |
| 82 | + "type": "string", |
| 83 | + "const": "partially configured" |
| 84 | + }, |
| 85 | + "name": { |
| 86 | + "type": "string", |
| 87 | + "description": "Name of the configuration" |
| 88 | + }, |
| 89 | + "description": { |
| 90 | + "type": "string", |
| 91 | + "description": "An asciidoc description of the configuration" |
| 92 | + }, |
| 93 | + "params": { |
| 94 | + "type": "object" |
| 95 | + }, |
121 | 96 | "mandatory_extensions": { |
122 | | - "type": "null" |
| 97 | + "description": "Extensions mandatory in this architecture", |
| 98 | + "type": "array", |
| 99 | + "items": { |
| 100 | + "$ref": "schema_defs.json#/$defs/extension_requirement" |
| 101 | + } |
123 | 102 | }, |
124 | 103 | "non_mandatory_extensions": { |
125 | | - "type": "null" |
| 104 | + "description": "Extensions that are not mandatory but are still _special_ in this architecture. This could mean different things depending on the context: for certificates or generated IP, this would correspond to _optional supported_, and extensions not in non_mandatory are not possible. For profiles, this corresponds to some type of _profile optional_, but extensions in non_mandatory are still possible.", |
| 105 | + "type": "array", |
| 106 | + "items": { |
| 107 | + "$ref": "schema_defs.json#/$defs/extension_requirement" |
| 108 | + } |
126 | 109 | }, |
127 | | - "prohbited_extensions": { |
128 | | - "type": "null" |
| 110 | + "prohibited_extensions": { |
| 111 | + "description": "Extensions explicitly prohibited in this architecture. Does *not* need to include extensions that are excluded because of a conflict-by-definition with a mandatory extension, as those will be calculated automatically", |
| 112 | + "type": "array", |
| 113 | + "items": { |
| 114 | + "$ref": "schema_defs.json#/$defs/extension_requirement" |
| 115 | + } |
129 | 116 | }, |
130 | | - "params": { |
| 117 | + "implemented_extensions": { |
131 | 118 | "type": "null" |
| 119 | + }, |
| 120 | + "additional_extensions": { |
| 121 | + "type": "boolean", |
| 122 | + "default": true, |
| 123 | + "description": "Whether or not a compliant instance of this partial config can have more extensions than those listed in mandatory_extensions/non_mandatory_extensions" |
132 | 124 | } |
133 | | - } |
134 | | - } |
135 | | - ], |
136 | | - "properties": { |
137 | | - "type": { |
138 | | - "type": "string", |
139 | | - "description": "Type of the arch", |
140 | | - "enum": ["unconfigured", "partially configured", "fully configured"] |
141 | | - }, |
142 | | - "$schema": { |
143 | | - "type": "string", |
144 | | - "format": "uri-reference", |
145 | | - "const": "config_schema.json#" |
146 | | - }, |
147 | | - "kind": { |
148 | | - "type": "string", |
149 | | - "const": "architecture configuration" |
150 | | - }, |
151 | | - "name": { |
152 | | - "type": "string" |
153 | | - }, |
154 | | - "description": { |
155 | | - "type": "string", |
156 | | - "description": "An asciidoc description of the configuration" |
| 125 | + }, |
| 126 | + "additionalProperties": false |
157 | 127 | }, |
158 | | - "params": true, |
159 | | - "mandatory_extensions": true, |
160 | | - "non_mandatory_extensions": true, |
161 | | - "prohibited_extensions": true, |
162 | | - "implemented_extensions": true |
| 128 | + "unconfiguration": { |
| 129 | + "type": "object", |
| 130 | + "required": ["$schema", "kind", "type", "name", "description"], |
| 131 | + "properties": { |
| 132 | + "$schema": { |
| 133 | + "type": "string", |
| 134 | + "format": "uri-reference", |
| 135 | + "const": "config_schema.json#" |
| 136 | + }, |
| 137 | + "kind": { |
| 138 | + "type": "string", |
| 139 | + "const": "architecture configuration" |
| 140 | + }, |
| 141 | + "type": { |
| 142 | + "type": "string", |
| 143 | + "const": "unconfigured" |
| 144 | + }, |
| 145 | + "name": { |
| 146 | + "type": "string", |
| 147 | + "description": "Name of the configuration" |
| 148 | + }, |
| 149 | + "description": { |
| 150 | + "type": "string", |
| 151 | + "description": "An asciidoc description of the configuration" |
| 152 | + } |
| 153 | + }, |
| 154 | + "additionalProperties": false |
| 155 | + } |
163 | 156 | }, |
164 | | - "additionalProperties": false |
| 157 | + |
| 158 | + "oneOf": [ |
| 159 | + { "$ref": "#/$defs/full_configuration" }, |
| 160 | + { "$ref": "#/$defs/partial_configuration" }, |
| 161 | + { "$ref": "#/$defs/unconfiguration" } |
| 162 | + ] |
165 | 163 | } |
0 commit comments