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