mock-from-json-schema
Simple utility to mock example objects based on JSON schema definitions. Copy from mock-json-schema, but not use lodash (less bundle size)
Installation
Node.js / Browserify
npm install mock-from-json-schema --save
; var schema = "title": "配置" "description": "" "type": "object" "properties": "name": "type": "string" "description": "商品名称" "title": "name" "list": "type": "array" "title": "list" "description": "列表" "items": "title": "" "description": "" "type": "object" "properties": "itemName": "type": "string" "description": "子项名称" "title": "itemName" "required": "itemName" "required": "name" ; console; // 输出:// {// "name": "string",// "list": [// {// "itemName": "string"// }// ]// }
Build & test
npm run build
npm test
npm run doc
then open the generated out/index.html
file in your browser.
License
MIT.