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