Generate Java types from JSON or JSON Schema and annotates those types for data-binding with Jackson, Gson, etc
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
jsonschema2pojo-ant [maven-release-plugin] prepare for next development iteration Dec 13, 2018
jsonschema2pojo-cli [maven-release-plugin] prepare for next development iteration Dec 13, 2018
jsonschema2pojo-core [maven-release-plugin] prepare for next development iteration Dec 13, 2018
jsonschema2pojo-gradle-plugin [maven-release-plugin] prepare for next development iteration Dec 13, 2018
jsonschema2pojo-integration-tests [maven-release-plugin] prepare for next development iteration Dec 13, 2018
jsonschema2pojo-maven-plugin [maven-release-plugin] prepare for next development iteration Dec 13, 2018
jsonschema2pojo-scalagen [maven-release-plugin] prepare for next development iteration Dec 13, 2018
.gitignore added .DS_Store to ignored files Dec 30, 2015
.travis.yml Move to Java 8 Jun 4, 2018
CHANGELOG.md [release] Update README.md, CHANGELOG.md and CONTRIBUTORS.md for 1.0.0 Dec 14, 2018
CONTRIBUTING.md Create CONTRIBUTING.md Sep 11, 2017
CONTRIBUTORS.md [release] Update README.md, CHANGELOG.md and CONTRIBUTORS.md for 1.0.0 Dec 14, 2018
LICENSE Moved LICENSE and NOTICE to their preferred location May 30, 2012
NOTICE License date update Jun 11, 2017
README.md [release] Update README.md, CHANGELOG.md and CONTRIBUTORS.md for 1.0.0 Dec 14, 2018
jsonschema2pojo-eclipse-formatter.xml Add Eclipse code formatter config to help contributors Aug 29, 2012
jsonschema2pojo-eclipse-preferences.epf Add Eclipse Java style preferences to help contributors Jun 22, 2013
jsonschema2pojo-upload-release Allow releases to be uploaded without changing current version in docs Feb 1, 2018
pom.xml [maven-release-plugin] prepare for next development iteration Dec 13, 2018

README.md

jsonschema2pojo Build Status Maven Central

jsonschema2pojo generates Java types from JSON Schema (or example JSON) and can annotate those types for data-binding with Jackson 1.x, Jackson 2.x or Gson.

Note: there are breaking changes between 0.5.1 and 1.0.0. Check the change log. Anything marked in bold in the 1.0.0 alpha, beta and final release is a breaking change.

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.0.0</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:

Project resources:

Licensed under the Apache License, Version 2.0.

YourKit

Special thanks to YourKit, who support this project through a free license for their full-featured YourKit Java Profiler.