Generate Java types from JSON or JSON Schema and annotates those types for data-binding with Jackson, Gson, etc
Java Scala HTML Groovy Other
Switch branches/tags
Clone or download
Latest commit d7ead7b Jul 18, 2018
Permalink
Failed to load latest commit information.
jsonschema2pojo-ant Remove includeAccessors, use only includeGetters/includeSetters Jun 13, 2018
jsonschema2pojo-cli Remove includeAccessors, use only includeGetters/includeSetters Jun 13, 2018
jsonschema2pojo-core Remove includeAccessors, use only includeGetters/includeSetters Jun 13, 2018
jsonschema2pojo-gradle-plugin Remove includeAccessors, use only includeGetters/includeSetters Jun 13, 2018
jsonschema2pojo-integration-tests Remove includeAccessors, use only includeGetters/includeSetters Jun 13, 2018
jsonschema2pojo-maven-plugin Remove includeAccessors, use only includeGetters/includeSetters Jun 13, 2018
jsonschema2pojo-scalagen [maven-release-plugin] prepare for next development iteration Jun 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 CHANGELOG.md 1.0.0-alpha4 Jun 13, 2018
CONTRIBUTING.md Create CONTRIBUTING.md Sep 11, 2017
CONTRIBUTORS.md [release] Update CHANGELOG.md and CONTRIBUTORS.md for 1.0.0-alpha3 Jun 12, 2018
LICENSE Moved LICENSE and NOTICE to their preferred location May 30, 2012
NOTICE License date update Jun 11, 2017
README.md Update README.md Jul 18, 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 Jun 13, 2018

README.md

jsonschema2pojo Build Status Maven Central

Current stable: 0.5.1
Current unstable: 1.0.0-alpha4
Next unstable: 1.0.0-beta1

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.

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>0.5.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:

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.