japsu / json-schema-by-example Goto Github PK
View Code? Open in Web Editor NEWGenerate a JSON schema from an example object
Generate a JSON schema from an example object
Steps to reproduce:
const schemaByExample = require('json-schema-by-example');
schemaByExample([])
Expected:
{ type: 'array' }
Actual:
TypeError
Affects 0.2.0, regression from 0.1.0
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'json-schema-by-example' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly rollbackFailedOptional Starting
8 silly rollbackFailedOptional Finishing
9 silly runTopLevelLifecycles Starting
10 silly runTopLevelLifecycles Finishing
11 silly install printInstalled
12 verbose stack Error: Failed to parse json
12 verbose stack No value found for key type at 46:27
12 verbose stack "row" : {"type" : iterator},
12 verbose stack ^
12 verbose stack at parseError (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:390:11)
12 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:79:23)
12 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:48:5
12 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16
12 verbose stack at tryToString (fs.js:449:3)
12 verbose stack at FSReqWrap.readFileAfterClose as oncomplete
13 verbose cwd /Users/yingyang/Documents/JavaScript/DataCleaning
14 error Darwin 14.5.0
15 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "json-schema-by-example"
16 error node v6.2.1
17 error npm v3.9.3
18 error file /Users/yingyang/Documents/JavaScript/DataCleaning/package.json
19 error code EJSONPARSE
20 error Failed to parse json
20 error No value found for key type at 46:27
20 error "row" : {"type" : iterator},
20 error ^
21 error File: /Users/yingyang/Documents/JavaScript/DataCleaning/package.json
22 error Failed to parse package.json data.
22 error package.json must be actual JSON, not just JavaScript.
22 error
22 error This is not a bug in npm.
22 error Tell the package author to fix their package.json file. JSON.parse
23 verbose exit [ 1, true ]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.