https://github.com/joelittlejohn/jsonschema2pojo
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
https://github.com/joelittlejohn/jsonschema2pojo
ant-task gradle-plugin gson jackson java json json-schema maven-plugin
Last synced: 3 months ago
JSON representation
Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
- Host: GitHub
- URL: https://github.com/joelittlejohn/jsonschema2pojo
- Owner: joelittlejohn
- License: apache-2.0
- Created: 2013-06-22T22:28:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2025-09-06T09:13:34.000Z (3 months ago)
- Last Synced: 2025-09-09T06:10:06.102Z (3 months ago)
- Topics: ant-task, gradle-plugin, gson, jackson, java, json, json-schema, maven-plugin
- Language: Java
- Homepage: http://www.jsonschema2pojo.org
- Size: 11.7 MB
- Stars: 6,331
- Watchers: 193
- Forks: 1,673
- Open Issues: 247
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesomesource - JsonSchema2Pojo
- awesome-json - jsonschema2pojo - Generates Java types and annotates those types for data-binding with Jackson 1.x or 2.x, Gson, etc. (JSON Schema Tools)
- useful-java-links - Jsonschema2pojo - binding with Jackson 1.x or 2.x, Gson, etc. , [](https://github.com/joelittlejohn/jsonschema2pojo). [User guide](https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started) and [Hello World examples](https://github.com/Vedenin/useful-java-links/tree/master/helloworlds/3.8-json/jsonschema2pojo). License: [Apache 2](http://www.apache.org/licenses/LICENSE-2.0).  (III. Network and Integration / 8. Json)
README
# jsonschema2pojo [](https://github.com/joelittlejohn/jsonschema2pojo/actions/workflows/ci.yml?query=branch%3Amaster) [](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jsonschema2pojo%22)
_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](http://jsonschema2pojo.org/)
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](https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started) guide will show you how.
A very simple Maven example:
```xml
org.jsonschema2pojo
jsonschema2pojo-maven-plugin
1.2.2
${basedir}/src/main/resources/schema
com.example.types
generate
```
A very simple Gradle example:
```groovy
plugins {
id "java"
id "org.jsonschema2pojo" version "1.2.2"
}
repositories {
mavenCentral()
}
jsonSchema2Pojo {
targetPackage = 'com.example'
}
```
Useful pages:
* **[Getting started](https://github.com/joelittlejohn/jsonschema2pojo/wiki/Getting-Started)**
* **[How to contribute](https://github.com/joelittlejohn/jsonschema2pojo/blob/master/CONTRIBUTING.md)**
* [Reference](https://github.com/joelittlejohn/jsonschema2pojo/wiki/Reference)
* [Latest Javadocs](https://joelittlejohn.github.io/jsonschema2pojo/javadocs/1.2.2/)
* [Documentation for the Maven plugin](https://joelittlejohn.github.io/jsonschema2pojo/site/1.2.2/generate-mojo.html)
* [Documentation for the Gradle plugin](https://github.com/joelittlejohn/jsonschema2pojo/tree/master/jsonschema2pojo-gradle-plugin#usage)
* [Documentation for the Ant task](https://joelittlejohn.github.io/jsonschema2pojo/site/1.2.2/Jsonschema2PojoTask.html)
Project resources:
* [Downloads](https://github.com/joelittlejohn/jsonschema2pojo/releases)
* [Mailing list](https://groups.google.com/forum/#!forum/jsonschema2pojo-users)
Special thanks:
* unkish
* Thach Hoang
* Dan Cruver
* Ben Manes
* Sam Duke
* Duane Zamrok
* Christian Trimble
* YourKit, who support this project through a free license for the [YourKit Java Profiler](https://www.yourkit.com/java/profiler).
Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).