Utility for converting JSON Schema to MobX State Tree types.
JSON Schema: http://json-schema.org/
MobX State Tree Types: https://github.com/mobxjs/mobx-state-tree#types-overview
Use Case:
Let's say we had an event
schema that looked like this:
type: 'object' title: 'Event' properties: title: type: 'string' public: type: 'boolean' default: false time: type: 'object' properties: start: type: 'string' format: 'datetime' end: type: 'string' format: 'datetime' required: 'start' required: 'title' 'public'
Should output:
types;
Usage:
$ npm install --save jsonschema-to-mobx-state-tree
const types = ;const jsonSchemaToTypes = types; ;
We can additionally pass on an onNode
function to be called every node, whose
response will be used in place of the node that would have been returned in
the conversion.
;