• Stars
    star
    6,200
  • Rank 6,469 (Top 0.2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

A very simple Gradle example:

plugins {
  id "java"
  id "org.jsonschema2pojo" version "1.2.1"
}

repositories {
  mavenCentral()
}

dependencies {
  implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.2'
}

jsonSchema2Pojo {
  targetPackage = 'com.example'
}

Useful pages:

Project resources:

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.

Licensed under the Apache License, Version 2.0.

More Repositories

1

embedmongo-maven-plugin

Maven plugin wrapper for the flapdoodle.de embedded MongoDB API
Java
88
star
2

paredit-cheatsheet

A new, scalable source document for the Paredit Cheatsheet available as a png on the Emacs wiki
TeX
61
star
3

clj-http-hystrix

A Clojure library to wrap clj-http requests as hystrix commands
Clojure
22
star
4

lein-embongo

Leiningen plugin for running 'embedded' MongoDB
Clojure
9
star
5

party

A Clojure library that wraps the Curator service discovery/registration API and provides a set of Clojure functions to quickly and easily discover/register a service/resource
Clojure
8
star
6

clj-wrap-indent

A Clojure library to wrap, indent and (if required) print paragraphs.
Clojure
5
star
7

zookem

Clojure and Leiningen helper for running embedded Zookeeper instances for integration testing.
Clojure
4
star
8

lein-project-clean

A lein plugin to tidy/refactor source files in a project via refactor-nrepl middleware
Clojure
4
star
9

lein-h2

A Leiningen plugin to start an H2 server in tcp mode.
Clojure
3
star
10

js-ps

Convert JSON schema to Prismatic/Plumatic schema
Clojure
3
star
11

atomist-compojure-api

Clojure
2
star
12

combidi

An example combining bidi routing with compojure destructuring via rfn.
Clojure
2
star
13

arduieensy-deployment-alert

Sources for controlling a Teensy 2.0 based alerting orb (that flashes when you need to move your deployment on)
Clojure
2
star
14

transit-bench

Some micro-benchmarks for JSON, MessagePack, Transit/JSON, Transit/MessagePack.
Clojure
2
star
15

99-Problems

The 99 [Prolog] problems in Clojure (based on the set adapted for Lisps)
Clojure
2
star
16

joelittlejohn.github.com

1
star
17

arduieensy-extreme-feedback

Sources for controlling a Teensy 2.0 based extreme-feedback device (that polls Jenkins)
Java
1
star
18

prittstick

A high resolution reproduction of the Pritt glue stick packaging
1
star
19

.emacs.d

An Emacs configuration inspired by the features of emacs-live by Sam Aaron, but minimal and built from scratch (requires Emacs 25 or later)
Emacs Lisp
1
star
20

environ-files

Explore the possibility of reading an environ env map from a file
Clojure
1
star
21

jdk7-sandbox

Experiments with new API and language features of Java 7
Java
1
star
22

clingo

Answer-set programming with Clingo
1
star