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