Skip to content

Commit

Permalink
zip the buffer paths and data attributes to ease debugging
Browse files Browse the repository at this point in the history
Now a model state can have structure like:

```
state: ...
buffers: {
  buffers: [
    {path: ["a", 1, "b"], data: "AFE0139AB"},
    {path: ["x", 0], data: "45E01FE"}
  ],
  encoding: "hex"
}
```
  • Loading branch information
jasongrout committed Apr 20, 2017
1 parent 66c6033 commit 2416a6d
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions jupyter-widgets-schema/v2/state.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,29 @@
"description": "Binary buffers in the state",
"type": "object",
"properties": {
"paths": {
"description" : "Array of paths in the state for the corresponding buffers",
"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"]
}
"type": "object",
"properties": {
"path": {
"description": "A path for a binary buffer value.",
"type": "array",
"items": {
"description": "An object key or array index",
"type": ["string", "number"]
}
},
"data": {
"description" : "A binary buffer encoded as specified in the 'encoding' property",
"type": "string"
}
},
"required": ["path", "data"]
}
},
"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",
"description": "The encoding of each buffer 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)"},
Expand All @@ -65,7 +70,7 @@
]
}
},
"required": ["paths", "data", "encoding"]
"required": ["buffers", "encoding"]
}
},
"required": [ "model_name", "model_module", "state" ]
Expand Down

0 comments on commit 2416a6d

Please sign in to comment.