You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
3.5 KiB

4 years ago
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "description": "Jupyter Interactive Widget State JSON schema.",
  4. "type": "object",
  5. "properties" : {
  6. "version_major" : {
  7. "description": "Format version (major)",
  8. "type": "number",
  9. "minimum": 2,
  10. "maximum": 2
  11. },
  12. "version_minor" : {
  13. "description": "Format version (minor)",
  14. "type": "number",
  15. "minimum": 0,
  16. "maximum": 0
  17. },
  18. "state": {
  19. "description": "Model State for All Widget Models - keys are model ids, values are model state",
  20. "type": "object",
  21. "additionalProperties" : {
  22. "type": "object",
  23. "properties": {
  24. "model_name": {
  25. "description" : "Name of the JavaScript class holding the model implementation",
  26. "type": "string"
  27. },
  28. "model_module": {
  29. "description" : "Name of the JavaScript module holding the model implementation",
  30. "type": "string"
  31. },
  32. "model_module_version": {
  33. "description" : "Semver range for the JavaScript module holding the model implementation",
  34. "type": "string"
  35. },
  36. "state": {
  37. "description" : "Serialized state of the model",
  38. "type": "object"
  39. },
  40. "buffers": {
  41. "description": "Binary buffers in the state",
  42. "type": "array",
  43. "items": {
  44. "type": "object",
  45. "properties": {
  46. "path": {
  47. "description": "A path for a binary buffer value.",
  48. "type": "array",
  49. "items": {
  50. "description": "An object key or array index",
  51. "type": ["string", "number"]
  52. }
  53. },
  54. "data": {
  55. "description" : "A binary buffer encoded as specified in the 'encoding' property",
  56. "type": "string"
  57. },
  58. "encoding": {
  59. "description": "The encoding of the buffer data",
  60. "type": "string",
  61. "oneOf": [
  62. {"enum": ["hex"], "description": "Base 16 encoding, as specified in RFC 4648, section 8 (https://tools.ietf.org/html/rfc4648#section-8)"},
  63. {"enum": ["base64"], "description": "Base 64 encoding, as specified in RFC 4648, section 4 (https://tools.ietf.org/html/rfc4648#section-4)"}
  64. ]
  65. }
  66. },
  67. "required": ["path", "data", "encoding"]
  68. }
  69. }
  70. },
  71. "required": [ "model_name", "model_module", "state" ]
  72. }
  73. }
  74. },
  75. "required": [ "version_major", "version_minor", "state" ]
  76. }