Skip to content

Commit ce0783a

Browse files
authored
Merge pull request #662 from wking/json-schema-no-pointer
schema: Drop pointers and nulls
2 parents 7278567 + 0927437 commit ce0783a

File tree

5 files changed

+36
-144
lines changed

5 files changed

+36
-144
lines changed

schema/config-linux.json

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@
7272
"properties": {
7373
"blkioWeight": {
7474
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioWeight",
75-
"$ref": "defs-linux.json#/definitions/blkioWeightPointer"
75+
"$ref": "defs-linux.json#/definitions/blkioWeight"
7676
},
7777
"blkioLeafWeight": {
7878
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioLeafWeight",
79-
"$ref": "defs-linux.json#/definitions/blkioWeightPointer"
79+
"$ref": "defs-linux.json#/definitions/blkioWeight"
8080
},
8181
"blkioThrottleReadBpsDevice": {
8282
"id": "https://opencontainers.org/schema/bundle/linux/resources/blockIO/blkioThrottleReadBpsDevice",
@@ -129,23 +129,23 @@
129129
},
130130
"period": {
131131
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/period",
132-
"$ref": "defs.json#/definitions/uint64Pointer"
132+
"$ref": "defs.json#/definitions/uint64"
133133
},
134134
"quota": {
135135
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/quota",
136-
"$ref": "defs.json#/definitions/int64Pointer"
136+
"$ref": "defs.json#/definitions/int64"
137137
},
138138
"realtimePeriod": {
139139
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimePeriod",
140-
"$ref": "defs.json#/definitions/uint64Pointer"
140+
"$ref": "defs.json#/definitions/uint64"
141141
},
142142
"realtimeRuntime": {
143143
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/realtimeRuntime",
144-
"$ref": "defs.json#/definitions/int64Pointer"
144+
"$ref": "defs.json#/definitions/int64"
145145
},
146146
"shares": {
147147
"id": "https://opencontainers.org/schema/bundle/linux/resources/cpu/shares",
148-
"$ref": "defs.json#/definitions/uint64Pointer"
148+
"$ref": "defs.json#/definitions/uint64"
149149
}
150150
}
151151
},
@@ -178,27 +178,27 @@
178178
"properties": {
179179
"kernel": {
180180
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernel",
181-
"$ref": "defs.json#/definitions/int64Pointer"
181+
"$ref": "defs.json#/definitions/int64"
182182
},
183183
"kernelTCP": {
184184
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/kernelTCP",
185-
"$ref": "defs.json#/definitions/int64Pointer"
185+
"$ref": "defs.json#/definitions/int64"
186186
},
187187
"limit": {
188188
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/limit",
189-
"$ref": "defs.json#/definitions/int64Pointer"
189+
"$ref": "defs.json#/definitions/int64"
190190
},
191191
"reservation": {
192192
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/reservation",
193-
"$ref": "defs.json#/definitions/int64Pointer"
193+
"$ref": "defs.json#/definitions/int64"
194194
},
195195
"swap": {
196196
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swap",
197-
"$ref": "defs.json#/definitions/int64Pointer"
197+
"$ref": "defs.json#/definitions/int64"
198198
},
199199
"swappiness": {
200200
"id": "https://opencontainers.org/schema/bundle/linux/resources/memory/swappiness",
201-
"$ref": "defs.json#/definitions/uint64Pointer"
201+
"$ref": "defs.json#/definitions/uint64"
202202
}
203203
}
204204
},
@@ -255,14 +255,7 @@
255255
},
256256
"sysctl": {
257257
"id": "https://opencontainers.org/schema/bundle/linux/sysctl",
258-
"oneOf": [
259-
{
260-
"$ref": "defs.json#/definitions/mapStringString"
261-
},
262-
{
263-
"type": "null"
264-
}
265-
]
258+
"$ref": "defs.json#/definitions/mapStringString"
266259
},
267260
"maskedPaths": {
268261
"id": "https://opencontainers.org/schema/bundle/linux/maskedPaths",

schema/config-windows.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
"properties": {
1515
"limit": {
1616
"id": "https://opencontainers.org/schema/bundle/windows/resources/memory/limit",
17-
"$ref": "defs.json#/definitions/uint64Pointer"
17+
"$ref": "defs.json#/definitions/uint64"
1818
},
1919
"reservation": {
2020
"id": "https://opencontainers.org/schema/bundle/windows/resources/memory/reservation",
21-
"$ref": "defs.json#/definitions/uint64Pointer"
21+
"$ref": "defs.json#/definitions/uint64"
2222
}
2323
}
2424
},
@@ -28,15 +28,15 @@
2828
"properties": {
2929
"count": {
3030
"id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/count",
31-
"$ref": "defs.json#/definitions/uint64Pointer"
31+
"$ref": "defs.json#/definitions/uint64"
3232
},
3333
"shares": {
3434
"id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/shares",
35-
"$ref": "defs-windows.json#/definitions/cpuSharesPointer"
35+
"$ref": "defs-windows.json#/definitions/cpuShares"
3636
},
3737
"percent": {
3838
"id": "https://opencontainers.org/schema/bundle/windows/resources/cpu/percent",
39-
"$ref": "defs.json#/definitions/percentPointer"
39+
"$ref": "defs.json#/definitions/percent"
4040
}
4141
}
4242
},
@@ -46,15 +46,15 @@
4646
"properties": {
4747
"iops": {
4848
"id": "https://opencontainers.org/schema/bundle/windows/resources/storage/iops",
49-
"$ref": "defs.json#/definitions/uint64Pointer"
49+
"$ref": "defs.json#/definitions/uint64"
5050
},
5151
"bps": {
5252
"id": "https://opencontainers.org/schema/bundle/windows/resources/storage/bps",
53-
"$ref": "defs.json#/definitions/uint64Pointer"
53+
"$ref": "defs.json#/definitions/uint64"
5454
},
5555
"sandboxSize": {
5656
"id": "https://opencontainers.org/schema/bundle/windows/resources/storage/sandboxSize",
57-
"$ref": "defs.json#/definitions/uint64Pointer"
57+
"$ref": "defs.json#/definitions/uint64"
5858
}
5959
}
6060
},
@@ -64,7 +64,7 @@
6464
"properties": {
6565
"egressBandwidth": {
6666
"id": "https://opencontainers.org/schema/bundle/windows/resources/network/egressBandwidth",
67-
"$ref": "defs.json#/definitions/uint64Pointer"
67+
"$ref": "defs.json#/definitions/uint64"
6868
}
6969
}
7070
}

schema/defs-linux.json

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,10 @@
126126
"$ref": "#/definitions/Minor"
127127
},
128128
"uid": {
129-
"oneOf": [
130-
{
131-
"$ref": "defs.json#/definitions/UID"
132-
},
133-
{
134-
"type": "null"
135-
}
136-
]
129+
"$ref": "defs.json#/definitions/UID"
137130
},
138131
"gid": {
139-
"oneOf": [
140-
{
141-
"$ref": "defs.json#/definitions/GID"
142-
},
143-
{
144-
"type": "null"
145-
}
146-
]
132+
"$ref": "defs.json#/definitions/GID"
147133
}
148134
}
149135
},
@@ -152,16 +138,6 @@
152138
"minimum": 10,
153139
"maximum": 1000
154140
},
155-
"blkioWeightPointer": {
156-
"oneOf": [
157-
{
158-
"$ref": "#/definitions/blkioWeight"
159-
},
160-
{
161-
"type": "null"
162-
}
163-
]
164-
},
165141
"blockIODevice": {
166142
"type": "object",
167143
"properties": {
@@ -187,10 +163,10 @@
187163
"type": "object",
188164
"properties": {
189165
"weight": {
190-
"$ref": "#/definitions/blkioWeightPointer"
166+
"$ref": "#/definitions/blkioWeight"
191167
},
192168
"leafWeight": {
193-
"$ref": "#/definitions/blkioWeightPointer"
169+
"$ref": "#/definitions/blkioWeight"
194170
}
195171
}
196172
}
@@ -221,24 +197,10 @@
221197
"$ref": "string"
222198
},
223199
"major": {
224-
"oneOf": [
225-
{
226-
"$ref": "#/definitions/Major"
227-
},
228-
{
229-
"type": "null"
230-
}
231-
]
200+
"$ref": "#/definitions/Major"
232201
},
233202
"minor": {
234-
"oneOf": [
235-
{
236-
"$ref": "#/definitions/Minor"
237-
},
238-
{
239-
"type": "null"
240-
}
241-
]
203+
"$ref": "#/definitions/Minor"
242204
},
243205
"access": {
244206
"$ref": "string"

schema/defs-windows.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@
55
"type": "integer",
66
"minimum": 1,
77
"maximum": 10000
8-
},
9-
"cpuSharesPointer": {
10-
"oneOf": [
11-
{
12-
"$ref": "#/definitions/cpuShares"
13-
},
14-
{
15-
"type": "null"
16-
}
17-
]
188
}
199
}
2010
}

schema/defs.json

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -46,56 +46,6 @@
4646
"minimum": 0,
4747
"maximum": 100
4848
},
49-
"intPointer": {
50-
"oneOf": [
51-
{
52-
"type": "integer"
53-
},
54-
{
55-
"type": "null"
56-
}
57-
]
58-
},
59-
"int64Pointer": {
60-
"oneOf": [
61-
{
62-
"$ref": "#/definitions/int64"
63-
},
64-
{
65-
"type": "null"
66-
}
67-
]
68-
},
69-
"uint16Pointer": {
70-
"oneOf": [
71-
{
72-
"$ref": "#/definitions/uint16"
73-
},
74-
{
75-
"type": "null"
76-
}
77-
]
78-
},
79-
"uint64Pointer": {
80-
"oneOf": [
81-
{
82-
"$ref": "#/definitions/uint64"
83-
},
84-
{
85-
"type": "null"
86-
}
87-
]
88-
},
89-
"percentPointer": {
90-
"oneOf": [
91-
{
92-
"$ref": "#/definitions/percent"
93-
},
94-
{
95-
"type": "null"
96-
}
97-
]
98-
},
9949
"mapStringString": {
10050
"type": "object",
10151
"patternProperties": {
@@ -141,9 +91,13 @@
14191
"$ref": "#/definitions/Env"
14292
},
14393
"timeout": {
144-
"$ref": "#/definitions/intPointer"
94+
"$ref": "#/definitions/int"
14595
}
146-
}
96+
},
97+
"required": [
98+
"args",
99+
"path"
100+
]
147101
},
148102
"ArrayOfHooks": {
149103
"type": "array",
@@ -197,14 +151,7 @@
197151
"type": "string"
198152
},
199153
"annotations": {
200-
"oneOf": [
201-
{
202-
"$ref": "#/definitions/mapStringString"
203-
},
204-
{
205-
"type": "null"
206-
}
207-
]
154+
"$ref": "#/definitions/mapStringString"
208155
}
209156
}
210157
}

0 commit comments

Comments
 (0)