jsonschema2pojo

Generate Java types from JSON or JSON Schema and annotates those types for data-binding with Jackson, Gson, etc

Github stars Tracking Chart

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 onlineor 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.2</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.

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

Main metrics

Overview
Name With Ownerjoelittlejohn/jsonschema2pojo
Primary LanguageJava
Program languageJava (Language Count: 5)
Platform
License:Apache License 2.0
所有者活动
Created At2013-06-22 22:28:53
Pushed At2024-12-19 23:29:11
Last Commit At2024-09-28 22:39:15
Release Count70
Last Release Namejsonschema2pojo-1.2.2 (Posted on 2024-09-19 22:51:56)
First Release Namejsonschema2pojo-0.2.0 (Posted on 2011-11-17 23:57:50)
用户参与
Stargazers Count6.3k
Watchers Count194
Fork Count1.7k
Commits Count1.3k
Has Issues Enabled
Issues Count1189
Issue Open Count181
Pull Requests Count253
Pull Requests Open Count64
Pull Requests Close Count166
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private