Skip to content

Commit

Permalink
Consolidate the buffer information into a single object, and add a ne…
Browse files Browse the repository at this point in the history
…w encoding attribute

We initially have the ‘hex’ and ‘base64’ encodings.

We unpublished the 0.2.0 package so we could replace version 2 of the spec with these updates, so we bump the package number to 0.3.0-beta.0
  • Loading branch information
jasongrout committed Apr 20, 2017
1 parent ad04dc9 commit 66c6033
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
2 changes: 1 addition & 1 deletion jupyter-js-widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"font-awesome": "^4.5.0",
"jquery": "^3.1.1",
"jquery-ui": "^1.12.1",
"jupyter-widgets-schema": "^0.2.0",
"jupyter-widgets-schema": "^0.3.0-beta.0",
"lolex": "^1.4.0",
"scriptjs": "^2.5.8",
"semver": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion jupyter-widgets-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jupyter-widgets-schema",
"version": "0.2.0",
"version": "0.3.0-beta.0",
"description": "Schemas for the Jupyter interactive Widgets",
"main": "index.js",
"scripts": {
Expand Down
50 changes: 31 additions & 19 deletions jupyter-widgets-schema/v2/state.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "number"
},
"state": {
"description": "Model State for All Widget Models",
"description": "Model State for All Widget Models - keys are model ids, values are model state",
"type": "object",
"additionalProperties" : {
"type": "object",
Expand All @@ -35,25 +35,37 @@
"description" : "Serialized state of the model",
"type": "object"
},
"buffer_paths": {
"description" : "Array of paths in the state for the corresponding buffers",
"type": "array",
"items": {
"description": "A path for a binary buffer value.",
"type": "array",
"items": {
"description": "An object key or array index",
"anyOf": [{"type": "string"}, {"type": "number"}]
}
}
},
"buffers": {
"description" : "Array of base64-encoded binary buffers",
"type": "array",
"items": {
"description": "A base64-encoded binary buffer",
"type": "string"
}
"description": "Binary buffers in the state",
"type": "object",
"properties": {
"paths": {
"description" : "Array of paths in the state for the corresponding buffers",
"type": "array",
"items": {
"description": "A path for a binary buffer value.",
"type": "array",
"items": {
"description": "An object key or array index",
"type": ["string", "number"]
}
}
},
"data": {
"description" : "Array of encoded binary buffers, encoded as specified in the 'encoding' property",
"type": "array"
},
"encoding": {
"description": "The encoding of each item in the data property",
"type": "string",
"oneOf": [
{"enum": ["hex"], "description": "Base 16 encoding, as specified in RFC 4648, section 8 (https://tools.ietf.org/html/rfc4648#section-8)"},
{"enum": ["base64"], "description": "Base 64 encoding, as specified in RFC 4648, section 4 (https://tools.ietf.org/html/rfc4648#section-4)"}

]
}
},
"required": ["paths", "data", "encoding"]
}
},
"required": [ "model_name", "model_module", "state" ]
Expand Down

0 comments on commit 66c6033

Please sign in to comment.