Convert JSON schemas to code - work with JSON using typed objects in C++, Objective-C, Java and generates validation code for JavaScript.
Use a version of [node.js][node] - v6 or higher. You may want to use [nvm][nvm] if you need multiple versions of node installed.
To install dependencies run:
$ npm install
To generate your first code run
node json2code.js $SCHEMA $PREFIX $PACKAGE
The options:
- $SCHEMA path to JSON schema file
- $PREFIX prepended to the class names for Objective-C & Java output
- $PACAKGE the Java package to generate this code under
You can then find your generated code in the output
folder.
JavaScript is expected to adhere to the Airbnb style guide. Pull requests will not merge unless:
- eslint checks pass
Please be sure to run npm test
before submitting your PR.