It can be tricky to figure out what might be wrong with your input JSON, so in order to give good error messages we could use a JSON-schema validator.
When we have statebox.proto as statebox.typedefs we can maybe use the Typedefs JSON backend to generate a schema for this?
can use either https://ajv.js.org or https://www.npmjs.com/package/jsonschema