##// END OF EJS Templates
update v4 schema mime-type expression...
MinRK -
Show More
@@ -1,344 +1,347 b''
1 1 {
2 2 "$schema": "http://json-schema.org/draft-04/schema#",
3 3 "description": "IPython Notebook v4.0 JSON schema.",
4 4 "type": "object",
5 5 "additionalProperties": false,
6 6 "required": ["metadata", "nbformat_minor", "nbformat", "cells"],
7 7 "properties": {
8 8 "metadata": {
9 9 "description": "Notebook root-level metadata.",
10 10 "type": "object",
11 11 "additionalProperties": true,
12 12 "properties": {
13 13 "kernel_info": {
14 14 "description": "Kernel information.",
15 15 "type": "object",
16 16 "required": ["name", "language"],
17 17 "properties": {
18 18 "name": {
19 19 "description": "Name of the kernel specification.",
20 20 "type": "string"
21 21 },
22 22 "language": {
23 23 "description": "The programming language which this kernel runs.",
24 24 "type": "string"
25 25 },
26 26 "codemirror_mode": {
27 27 "description": "The codemirror mode to use for code in this language.",
28 28 "type": "string"
29 29 }
30 30 }
31 31 },
32 32 "signature": {
33 33 "description": "Hash of the notebook.",
34 34 "type": "string"
35 35 },
36 36 "orig_nbformat": {
37 37 "description": "Original notebook format (major number) before converting the notebook between versions.",
38 38 "type": "integer",
39 39 "minimum": 1
40 40 }
41 41 }
42 42 },
43 43 "nbformat_minor": {
44 44 "description": "Notebook format (minor number). Incremented for backward compatible changes to the notebook format.",
45 45 "type": "integer",
46 46 "minimum": 0
47 47 },
48 48 "nbformat": {
49 49 "description": "Notebook format (major number). Incremented between backwards incompatible changes to the notebook format.",
50 50 "type": "integer",
51 51 "minimum": 4,
52 52 "maximum": 4
53 53 },
54 54 "cells": {
55 55 "description": "Array of cells of the current notebook.",
56 56 "type": "array",
57 57 "items": {
58 58 "type": "object",
59 59 "oneOf": [
60 60 {"$ref": "#/definitions/raw_cell"},
61 61 {"$ref": "#/definitions/markdown_cell"},
62 62 {"$ref": "#/definitions/heading_cell"},
63 63 {"$ref": "#/definitions/code_cell"}
64 64 ]
65 65 }
66 66 }
67 67 },
68 68
69 69 "definitions": {
70 70
71 71 "raw_cell": {
72 72 "description": "Notebook raw nbconvert cell.",
73 73 "type": "object",
74 74 "additionalProperties": false,
75 75 "required": ["cell_type", "metadata"],
76 76 "properties": {
77 77 "cell_type": {
78 78 "description": "String identifying the type of cell.",
79 79 "enum": ["raw"]
80 80 },
81 81 "metadata": {
82 82 "description": "Cell-level metadata.",
83 83 "type": "object",
84 84 "additionalProperties": true,
85 85 "properties": {
86 86 "format": {
87 87 "description": "Raw cell metadata format for nbconvert.",
88 88 "type": "string"
89 89 },
90 90 "name": {"$ref": "#/definitions/misc/metadata_name"},
91 91 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
92 92 }
93 93 },
94 94 "source": {"$ref": "#/definitions/misc/source"}
95 95 }
96 96 },
97 97
98 98 "markdown_cell": {
99 99 "description": "Notebook markdown cell.",
100 100 "type": "object",
101 101 "additionalProperties": false,
102 102 "required": ["cell_type", "metadata"],
103 103 "properties": {
104 104 "cell_type": {
105 105 "description": "String identifying the type of cell.",
106 106 "enum": ["markdown"]
107 107 },
108 108 "metadata": {
109 109 "description": "Cell-level metadata.",
110 110 "type": "object",
111 111 "properties": {
112 112 "name": {"$ref": "#/definitions/misc/metadata_name"},
113 113 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
114 114 },
115 115 "additionalProperties": true
116 116 },
117 117 "source": {"$ref": "#/definitions/misc/source"}
118 118 }
119 119 },
120 120
121 121 "heading_cell": {
122 122 "description": "Notebook heading cell.",
123 123 "type": "object",
124 124 "additionalProperties": false,
125 125 "required": ["cell_type", "metadata", "source", "level"],
126 126 "properties": {
127 127 "cell_type": {
128 128 "description": "String identifying the type of cell.",
129 129 "enum": ["heading"]
130 130 },
131 131 "metadata": {
132 132 "description": "Cell-level metadata.",
133 133 "type": "object",
134 134 "properties": {
135 135 "name": {"$ref": "#/definitions/misc/metadata_name"},
136 136 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
137 137 },
138 138 "additionalProperties": true
139 139 },
140 140 "source": {"$ref": "#/definitions/misc/source"},
141 141 "level": {
142 142 "description": "Level of heading cells.",
143 143 "type": "integer",
144 144 "minimum": 1,
145 145 "maximum": 6
146 146 }
147 147 }
148 148 },
149 149
150 150 "code_cell": {
151 151 "description": "Notebook code cell.",
152 152 "type": "object",
153 153 "additionalProperties": false,
154 154 "required": ["cell_type", "metadata", "source", "outputs", "prompt_number"],
155 155 "properties": {
156 156 "cell_type": {
157 157 "description": "String identifying the type of cell.",
158 158 "enum": ["code"]
159 159 },
160 160 "metadata": {
161 161 "description": "Cell-level metadata.",
162 162 "type": "object",
163 163 "additionalProperties": true,
164 164 "properties": {
165 165 "collapsed": {
166 166 "description": "Whether the cell is collapsed/expanded.",
167 167 "type": "boolean"
168 168 },
169 169 "autoscroll": {
170 170 "description": "Whether the cell's output is scrolled, unscrolled, or autoscrolled.",
171 171 "enum": [true, false, "auto"]
172 172 },
173 173 "name": {"$ref": "#/definitions/misc/metadata_name"},
174 174 "tags": {"$ref": "#/definitions/misc/metadata_tags"}
175 175 }
176 176 },
177 177 "source": {"$ref": "#/definitions/misc/source"},
178 178 "outputs": {
179 179 "description": "Execution, display, or stream outputs.",
180 180 "type": "array",
181 "items": {
182 "type": "object",
183 "oneOf": [
184 {"$ref": "#/definitions/execute_result"},
185 {"$ref": "#/definitions/display_data_output"},
186 {"$ref": "#/definitions/stream_output"},
187 {"$ref": "#/definitions/error_output"}
188 ]
189 }
181 "items": {"$ref": "#/definitions/output"}
190 182 },
191 183 "prompt_number": {
192 184 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
193 185 "type": ["integer", "null"],
194 186 "minimum": 0
195 187 }
196 188 }
197 189 },
198
190 "output": {
191 "type": "object",
192 "oneOf": [
193 {"$ref": "#/definitions/execute_result"},
194 {"$ref": "#/definitions/display_data"},
195 {"$ref": "#/definitions/stream"},
196 {"$ref": "#/definitions/error"}
197 ]
198 },
199 199 "execute_result": {
200 200 "description": "Result of executing a code cell.",
201 201 "type": "object",
202 202 "additionalProperties": false,
203 203 "required": ["output_type", "metadata", "prompt_number"],
204 204 "properties": {
205 205 "output_type": {
206 206 "description": "Type of cell output.",
207 207 "enum": ["execute_result"]
208 208 },
209 209 "prompt_number": {
210 210 "description": "A result's prompt number.",
211 211 "type": ["integer"],
212 212 "minimum": 0
213 213 },
214 "metadata": {"$ref": "#/definitions/misc/output_metadata"},
215 214 "application/json": {
216 215 "type": "object"
217 }
216 },
217 "metadata": {"$ref": "#/definitions/misc/output_metadata"}
218 218 },
219 219 "patternProperties": {
220 "^[a-zA-Z0-9\\-\\+]+/[a-zA-Z0-9\\-\\+]+": {
220 "^(?!application/json$)[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$": {
221 221 "description": "mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
222 222 "$ref": "#/definitions/misc/multiline_string"
223 223 }
224 224 }
225 225 },
226 226
227 "display_data_output": {
227 "display_data": {
228 228 "description": "Data displayed as a result of code cell execution.",
229 229 "type": "object",
230 230 "additionalProperties": false,
231 231 "required": ["output_type", "metadata"],
232 232 "properties": {
233 233 "output_type": {
234 234 "description": "Type of cell output.",
235 235 "enum": ["display_data"]
236 236 },
237 "application/json": {
238 "type": "object"
239 },
237 240 "metadata": {"$ref": "#/definitions/misc/output_metadata"}
238 241 },
239 242 "patternProperties": {
240 "^[a-zA-Z0-9\\-\\+]+/[a-zA-Z0-9\\-\\+]+": {
243 "^(?!application/json$)[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$": {
241 244 "description": "mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
242 245 "$ref": "#/definitions/misc/multiline_string"
243 246 }
244 247 }
245 248 },
246 249
247 "stream_output": {
250 "stream": {
248 251 "description": "Stream output from a code cell.",
249 252 "type": "object",
250 253 "additionalProperties": false,
251 254 "required": ["output_type", "metadata", "stream", "text"],
252 255 "properties": {
253 256 "output_type": {
254 257 "description": "Type of cell output.",
255 258 "enum": ["stream"]
256 259 },
257 260 "metadata": {"$ref": "#/definitions/misc/output_metadata"},
258 261 "stream": {
259 262 "description": "The stream type/destination.",
260 263 "type": "string"
261 264 },
262 265 "text": {
263 266 "description": "The stream's text output, represented as an array of strings.",
264 267 "$ref": "#/definitions/misc/multiline_string"
265 268 }
266 269 }
267 270 },
268 271
269 "error_output": {
272 "error": {
270 273 "description": "Output of an error that occurred during code cell execution.",
271 274 "type": "object",
272 275 "additionalProperties": false,
273 276 "required": ["output_type", "metadata", "ename", "evalue", "traceback"],
274 277 "properties": {
275 278 "output_type": {
276 279 "description": "Type of cell output.",
277 280 "enum": ["error"]
278 281 },
279 282 "metadata": {"$ref": "#/definitions/misc/output_metadata"},
280 283 "ename": {
281 284 "description": "The name of the error.",
282 285 "type": "string"
283 286 },
284 287 "evalue": {
285 288 "description": "The value, or message, of the error.",
286 289 "type": "string"
287 290 },
288 291 "traceback": {
289 292 "description": "The error's traceback, represented as an array of strings.",
290 293 "type": "array",
291 294 "items": {"type": "string"}
292 295 }
293 296 }
294 297 },
295 298
296 299 "misc": {
297 300 "metadata_name": {
298 301 "description": "The cell's name. If present, must be a non-empty string.",
299 302 "type": "string",
300 303 "pattern": "^.+$"
301 304 },
302 305 "metadata_tags": {
303 306 "description": "The cell's tags. Tags must be unique, and must not contain commas.",
304 307 "type": "array",
305 308 "uniqueItems": true,
306 309 "items": {
307 310 "type": "string",
308 311 "pattern": "^[^,]+$"
309 312 }
310 313 },
311 314 "source": {
312 315 "description": "Contents of the cell, represented as an array of lines.",
313 316 "$ref": "#/definitions/misc/multiline_string"
314 317 },
315 318 "prompt_number": {
316 319 "description": "The code cell's prompt number. Will be null if the cell has not been run.",
317 320 "type": ["integer", "null"],
318 321 "minimum": 0
319 322 },
320 323 "mimetype": {
321 324 "patternProperties": {
322 325 "^[a-zA-Z0-9\\-\\+]+/[a-zA-Z0-9\\-\\+]+": {
323 326 "description": "The cell's mimetype output (e.g. text/plain), represented as either an array of strings or a string.",
324 327 "$ref": "#/definitions/misc/multiline_string"
325 328 }
326 329 }
327 330 },
328 331 "output_metadata": {
329 332 "description": "Cell output metadata.",
330 333 "type": "object",
331 334 "additionalProperties": true
332 335 },
333 336 "multiline_string": {
334 337 "oneOf" : [
335 338 {"type": "string"},
336 339 {
337 340 "type": "array",
338 341 "items": {"type": "string"}
339 342 }
340 343 ]
341 344 }
342 345 }
343 346 }
344 347 }
General Comments 0
You need to be logged in to leave comments. Login now