Skip to content

Plain Old Data Objects generator framework based on JSON Schema representation

License

Notifications You must be signed in to change notification settings

gpspatacean/json-schema-podo-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plain Old Data Objects generator from JSON Schemas

Overview

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.

Supported generators

  • C++ - PODOs with RapidJSON serialization/deserialization
  • Java - just PODOs with lombok, no JSON library included by default

Getting started

Basic usage

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

Advanced features

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

Samples can be found in samples directory.

Authors

About

Plain Old Data Objects generator framework based on JSON Schema representation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published