https://github.com/opentok/json2code
Code generator for JSON serialization and deserialization on iOS and Android based on json schema
https://github.com/opentok/json2code
Last synced: 8 months ago
JSON representation
Code generator for JSON serialization and deserialization on iOS and Android based on json schema
- Host: GitHub
- URL: https://github.com/opentok/json2code
- Owner: opentok
- Created: 2014-03-16T00:13:31.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T04:24:15.000Z (over 1 year ago)
- Last Synced: 2024-04-30T05:30:51.044Z (over 1 year ago)
- Language: Java
- Size: 63.5 KB
- Stars: 9
- Watchers: 58
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
json2code
=========
Convert JSON schemas to code - work with JSON using typed objects in C++, Objective-C, Java and generates validation code for JavaScript.
How to get it running
---------------------
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.
Contributing
------------
JavaScript is expected to adhere to the [Airbnb style guide][asg]. Pull
requests will not merge unless:
* [eslint][eslint] checks pass
Please be sure to run `npm test` before submitting your PR.
[asg]: https://github.com/airbnb/javascript
[eslint]: http://eslint.org/