Automatically create Swift entities from JSON.
The most straightforward way to use JSON2Swift is through the JSON2Swift Web page, available at:
https://viteinfinite.github.io/json2swift
Click and type and click the HTML interface.
You can also build from sources by performing
npm install
node node_modules/gulp/bin/gulp.js build
You'll then be able to use the parseDocument(JSON, [writers]) function against a JavaScript object and by providing a list of writers.
The writers, i.e. the output format, currently supported are currently:
writers.base, supportingstructswriters.class, supportingclasseswriters.nsObject, supportingNSObjectswriters.argo, supporting Argowriters.unbox, supporting Unboxwriters.jsonJoy, supporting JSONJoywriters.realm, supporting Realm
Writers can be mixed and matched. For instance, you could provide the parseDocument function with an array composed of nsObject and argo writers:
parseDocument({"key": "value"}, [writers.base, writers.nsObject, writers.argo])
- Simone Civetta (@viteinfinite) - Xebia France
- Thanks to Paride Broggi for the precious feedback
You are encouraged to read the contributing document available in this repository. Thanks for your feedback!
