Code generation tool that generates Plain Old Data Objects with Serialization/Deserialization capabilities. This is a framework that uses mustache templating, using this java library. Starting from a JSON Schema input file, it will generate models that can be further used for interacting with a JSON that matches the specified schema. Heavily inspired from OpenAPI generator.
It is build as a framework, and new languages can be added. This will be detailed separately.
- C++ - PODOs with RapidJSON serialization/deserialization
- Java - just PODOs with lombok, no JSON library included by default
Run java -jar ./modules/cli-wrapper/target/podo-generator-cli-0.0.1-SNAPSHOT.jar generate -g cpp -i <schema/input/file.json> -o <output/directory>
.
This will generate the models using cpp
generator.
Also see java -jar ./modules/cli-wrapper/target/podo-generator-cli-0.0.1-SNAPSHOT.jar help
Generator specific properties are supported. The available custom properties of a generator can be seen by running
java -jar ./modules/cli-wrapper/target/podo-generator-cli-0.0.1-SNAPSHOT.jar config-help -g cpp
For instance, java -jar ./modules/cli-wrapper/target/podo-generator-cli-0.0.1-SNAPSHOT.jar generate -g cpp -i <schema/input/file.json> -o <output/directory> -genprops -ns=my_namespace,-l=mylib
will generate the models in the my_namespace
namespace, and build mylib
module.
Samples can be found in samples directory.
- George Spătăcean george.spatacean@gmail.com