Skip to content

Commit ad5b1ba

Browse files
committed
zip the buffer paths and data attributes to ease debugging
Now a model state can have structure like: ``` state: ... buffers: { buffers: [ {path: ["a", 1, "b"], data: "AFE0139AB"}, {path: ["x", 0], data: "45E01FE"} ], encoding: "hex" } ```
1 parent 66c6033 commit ad5b1ba

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

jupyter-widgets-schema/v2/state.schema.json

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,29 @@
3939
"description": "Binary buffers in the state",
4040
"type": "object",
4141
"properties": {
42-
"paths": {
43-
"description" : "Array of paths in the state for the corresponding buffers",
42+
"buffers": {
4443
"type": "array",
4544
"items": {
46-
"description": "A path for a binary buffer value.",
47-
"type": "array",
48-
"items": {
49-
"description": "An object key or array index",
50-
"type": ["string", "number"]
51-
}
45+
"type": "object",
46+
"properties": {
47+
"path": {
48+
"description": "A path for a binary buffer value.",
49+
"type": "array",
50+
"items": {
51+
"description": "An object key or array index",
52+
"type": ["string", "number"]
53+
}
54+
},
55+
"data": {
56+
"description" : "Array of encoded binary buffers, encoded as specified in the 'encoding' property",
57+
"type": "array"
58+
}
59+
},
60+
"required": ["path", "data"]
5261
}
5362
},
54-
"data": {
55-
"description" : "Array of encoded binary buffers, encoded as specified in the 'encoding' property",
56-
"type": "array"
57-
},
5863
"encoding": {
59-
"description": "The encoding of each item in the data property",
64+
"description": "The encoding of each buffer data property",
6065
"type": "string",
6166
"oneOf": [
6267
{"enum": ["hex"], "description": "Base 16 encoding, as specified in RFC 4648, section 8 (https://tools.ietf.org/html/rfc4648#section-8)"},
@@ -65,7 +70,7 @@
6570
]
6671
}
6772
},
68-
"required": ["paths", "data", "encoding"]
73+
"required": ["buffers", "encoding"]
6974
}
7075
},
7176
"required": [ "model_name", "model_module", "state" ]

0 commit comments

Comments
 (0)