jsonschema2pojo
![Maven Central](https://camo.githubusercontent.com/362a684e932cfda5b0f376d4e5b230410104598a3795c0571d48fe33412243b5/68747470733a2f2f6d6176656e2d6261646765732e6865726f6b756170702e636f6d2f6d6176656e2d63656e7472616c2f6f72672e6a736f6e736368656d6132706f6a6f2f6a736f6e736368656d6132706f6a6f2f62616467652e737667)
jsonschema2pojo generates Java types from JSON Schema (or example JSON) and can annotate those types for data-binding with Jackson 2.x or Gson.
Try jsonschema2pojo online
or brew install jsonschema2pojo
You can use jsonschema2pojo as a Maven plugin, an Ant task, a command line utility, a Gradle plugin or embedded within your own Java app. The Getting Started guide will show you how.
A very simple Maven example:
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>1.1.1</version>
<configuration>
<sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
<targetPackage>com.example.types</targetPackage>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
Useful pages:
- Getting started
- How to contribute
- Reference
- Latest Javadocs
- Documentation for the Maven plugin
- Documentation for the Gradle plugin
- Documentation for the Ant task
Project resources:
Licensed under the Apache License, Version 2.0.
Special thanks to YourKit, who support this project through a free license for their full-featured YourKit Java Profiler.