##// END OF EJS Templates
Reduce schema duplication by adding more references
Jessica B. Hamrick -
Show More
@@ -64,24 +64,6 b''
64
64
65 "definitions": {
65 "definitions": {
66
66
67 "cell_metadata_name": {
68 "description": "The cell's name. If present, must be a non-empty string.",
69 "type": "string",
70 "required": false,
71 "pattern": "^.+$"
72 },
73
74 "cell_metadata_tags": {
75 "description": "The cell's tags. Tags must be unique, and must not contain commas.",
76 "type": "array",
77 "required": false,
78 "uniqueItems": true,
79 "items": {
80 "type": "string",
81 "pattern": "^[^,]+$"
82 }
83 },
84
85 "raw_cell": {
67 "raw_cell": {
86 "description": "Notebook raw nbconvert cell.",
68 "description": "Notebook raw nbconvert cell.",
87 "type": "object",
69 "type": "object",
@@ -103,16 +85,11 b''
103 "type": "string",
85 "type": "string",
104 "required": false
86 "required": false
105 },
87 },
106 "name": {"$ref": "/definitions/cell_metadata_name"},
88 "name": {"$ref": "/definitions/misc/metadata_name"},
107 "tags": {"$ref": "/definitions/cell_metadata_tags"}
89 "tags": {"$ref": "/definitions/misc/metadata_tags"}
108 }
90 }
109 },
91 },
110 "source": {
92 "source": {"$ref": "/definitions/misc/source"}
111 "description": "Contents of the cell, represented as an array of lines.",
112 "type": "array",
113 "required": true,
114 "items": {"type": "string"}
115 }
116 }
93 }
117 },
94 },
118
95
@@ -131,17 +108,12 b''
131 "type": "object",
108 "type": "object",
132 "required": true,
109 "required": true,
133 "properties": {
110 "properties": {
134 "name": {"$ref": "/definitions/cell_metadata_name"},
111 "name": {"$ref": "/definitions/misc/metadata_name"},
135 "tags": {"$ref": "/definitions/cell_metadata_tags"}
112 "tags": {"$ref": "/definitions/misc/metadata_tags"}
136 },
113 },
137 "additionalProperties": true
114 "additionalProperties": true
138 },
115 },
139 "source": {
116 "source": {"$ref": "/definitions/misc/source"}
140 "description": "Contents of the cell, represented as an array of lines.",
141 "type": "array",
142 "required": true,
143 "items": {"type": "string"}
144 }
145 }
117 }
146 },
118 },
147
119
@@ -160,17 +132,12 b''
160 "type": "object",
132 "type": "object",
161 "required": true,
133 "required": true,
162 "properties": {
134 "properties": {
163 "name": {"$ref": "/definitions/cell_metadata_name"},
135 "name": {"$ref": "/definitions/misc/metadata_name"},
164 "tags": {"$ref": "/definitions/cell_metadata_tags"}
136 "tags": {"$ref": "/definitions/misc/metadata_tags"}
165 },
137 },
166 "additionalProperties": true
138 "additionalProperties": true
167 },
139 },
168 "source": {
140 "source": {"$ref": "/definitions/misc/source"},
169 "description": "Contents of the cell, represented as an array of lines.",
170 "type": "array",
171 "required": true,
172 "items": {"type": "string"}
173 },
174 "level": {
141 "level": {
175 "description": "Level of heading cells.",
142 "description": "Level of heading cells.",
176 "type": "integer",
143 "type": "integer",
@@ -207,16 +174,11 b''
207 "type": "boolean",
174 "type": "boolean",
208 "required": true
175 "required": true
209 },
176 },
210 "name": {"$ref": "/definitions/cell_metadata_name"},
177 "name": {"$ref": "/definitions/misc/metadata_name"},
211 "tags": {"$ref": "/definitions/cell_metadata_tags"}
178 "tags": {"$ref": "/definitions/misc/metadata_tags"}
212 }
179 }
213 },
180 },
214 "source": {
181 "source": {"$ref": "/definitions/misc/source"},
215 "description": "Contents of the cell, represented as an array of lines.",
216 "type": "array",
217 "required": true,
218 "items": {"type": "string"}
219 },
220 "outputs": {
182 "outputs": {
221 "description": "Execution, display, or stream outputs.",
183 "description": "Execution, display, or stream outputs.",
222 "type": "array",
184 "type": "array",
@@ -224,6 +186,7 b''
224 "items": {
186 "items": {
225 "type": [
187 "type": [
226 {"$ref": "/definitions/execute_output"},
188 {"$ref": "/definitions/execute_output"},
189 {"$ref": "/definitions/display_data_output"},
227 {"$ref": "/definitions/stream_output"},
190 {"$ref": "/definitions/stream_output"},
228 {"$ref": "/definitions/error_output"}
191 {"$ref": "/definitions/error_output"}
229 ]
192 ]
@@ -245,29 +208,28 b''
245 "properties": {
208 "properties": {
246 "output_type": {
209 "output_type": {
247 "description": "Type of cell output.",
210 "description": "Type of cell output.",
248 "enum": ["execute_output", "display_data"],
211 "enum": ["execute_output"],
249 "required": true
212 "required": true
250 },
213 },
251 "metadata": {
214 "metadata": {"$ref": "/definitions/misc/output_metadata"},
252 "description": "Cell output metadata.",
215 "prompt_number": {"$ref": "/definitions/misc/prompt_number"}
216 },
217 "patternProperties": {"$ref": "/definitions/misc/mimetype"}
218 },
219
220 "display_data_output": {
221 "description": "Data displayed as a result of code cell execution.",
253 "type": "object",
222 "type": "object",
254 "required": true,
223 "additionalProperties": false,
255 "additionalProperties": true
224 "properties": {
225 "output_type": {
226 "description": "Type of cell output.",
227 "enum": ["display_data"],
228 "required": true
256 },
229 },
257 "prompt_number": {
230 "metadata": {"$ref": "/definitions/misc/output_metadata"}
258 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
259 "type": ["integer", "null"],
260 "required": false,
261 "minimum": 0
262 }
263 },
231 },
264 "patternProperties": {
232 "patternProperties": {"$ref": "/definitions/misc/mimetype"}
265 "^[a-zA-Z0-9+-]+/[a-zA-Z0-9+-]+$": {
266 "description": "The cell's mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
267 "type": ["string", "array"],
268 "required": false
269 }
270 }
271 },
233 },
272
234
273 "stream_output": {
235 "stream_output": {
@@ -280,12 +242,7 b''
280 "enum": ["stream"],
242 "enum": ["stream"],
281 "required": true
243 "required": true
282 },
244 },
283 "metadata": {
245 "metadata": {"$ref": "/definitions/misc/output_metadata"},
284 "description": "Cell output metadata.",
285 "type": "object",
286 "required": true,
287 "additionalProperties": true
288 },
289 "stream": {
246 "stream": {
290 "description": "The stream type/destination.",
247 "description": "The stream type/destination.",
291 "type": "string",
248 "type": "string",
@@ -310,12 +267,7 b''
310 "enum": ["error"],
267 "enum": ["error"],
311 "required": true
268 "required": true
312 },
269 },
313 "metadata": {
270 "metadata": {"$ref": "/definitions/misc/output_metadata"},
314 "description": "Cell output metadata.",
315 "type": "object",
316 "required": true,
317 "additionalProperties": true
318 },
319 "ename": {
271 "ename": {
320 "description": "The name of the error.",
272 "description": "The name of the error.",
321 "type": "string",
273 "type": "string",
@@ -333,6 +285,50 b''
333 "items": {"type": "string"}
285 "items": {"type": "string"}
334 }
286 }
335 }
287 }
288 },
289
290 "misc": {
291 "metadata_name": {
292 "description": "The cell's name. If present, must be a non-empty string.",
293 "type": "string",
294 "required": false,
295 "pattern": "^.+$"
296 },
297 "metadata_tags": {
298 "description": "The cell's tags. Tags must be unique, and must not contain commas.",
299 "type": "array",
300 "required": false,
301 "uniqueItems": true,
302 "items": {
303 "type": "string",
304 "pattern": "^[^,]+$"
305 }
306 },
307 "source": {
308 "description": "Contents of the cell, represented as an array of lines.",
309 "type": "array",
310 "required": true,
311 "items": {"type": "string"}
312 },
313 "prompt_number": {
314 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
315 "type": ["integer", "null"],
316 "required": true,
317 "minimum": 0
318 },
319 "mimetype": {
320 "^[a-zA-Z0-9+-]+/[a-zA-Z0-9+-]+$": {
321 "description": "The cell's mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
322 "type": ["string", "array"],
323 "required": false
324 }
325 },
326 "output_metadata": {
327 "description": "Cell output metadata.",
328 "type": "object",
329 "required": true,
330 "additionalProperties": true
331 }
336 }
332 }
337 }
333 }
338 }
334 }
General Comments 0
You need to be logged in to leave comments. Login now