MCPcopy
hub / github.com/joelittlejohn/jsonschema2pojo

github.com/joelittlejohn/jsonschema2pojo @jsonschema2pojo-1.3.3 sqlite

repository ↗ · DeepWiki ↗ · release jsonschema2pojo-1.3.3 ↗
2,022 symbols 6,695 edges 222 files 339 documented · 17%
README

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, Jackson 3.x, or Gson.

Try jsonschema2pojo online

or brew install jsonschema2pojo

You can use jsonschema2pojo as a Maven plugin, 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.3.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>

A very simple Gradle example:

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

repositories {
  mavenCentral()
}

jsonSchema2Pojo {
  targetPackage = 'com.example'
}

Useful pages: * Getting started * How to contribute * Reference * Latest Javadocs * Documentation for the Maven plugin * Documentation for the Gradle plugin

Project resources: * Downloads * Mailing list

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.

Extension points exported contracts — how you extend this code

Annotator (Interface)
Adds annotations to generated types for compatibility with a JSON serialization library. Annotators that need the ge [6 …
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/Annotator.java
InterfaceWithGenerics (Interface)
(no doc)
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/TypeIT.java
GenerationConfig (Interface)
Defines the configuration options for Java type generation, including source and target paths/packages and all behaviour [6 …
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/GenerationConfig.java
InterfaceWithGenerics (Interface)
(no doc)
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/yaml/YamlTypeIT.java
Rule (Interface)
Represents a JSON Schema rule (production from JSON Schema). Can be executed or 'applied' to perform the code generation [29 …
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/Rule.java
RuleLogger (Interface)
(no doc) [1 implementers]
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/RuleLogger.java

Core symbols most depended-on inside this repo

getName
called by 265
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/model/EnumValueDefinition.java
getReturnType
called by 171
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/PropertyRule.java
apply
called by 143
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/Rule.java
getGenerationConfig
called by 120
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/RuleFactory.java
fullName
called by 118
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/model/JAnnotatedClass.java
name
called by 83
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/model/JAnnotatedClass.java
toString
called by 74
jsonschema2pojo-cli/src/main/java/org/jsonschema2pojo/cli/CommandLineLogger.java
equals
called by 73
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/model/JAnnotatedClass.java

Shape

Method 1,765
Class 244
Enum 7
Interface 6

Languages

Java100%

Modules by API surface

jsonschema2pojo-maven-plugin/src/main/java/org/jsonschema2pojo/maven/Jsonschema2PojoMojo.java70 symbols
jsonschema2pojo-cli/src/main/java/org/jsonschema2pojo/cli/Arguments.java69 symbols
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/GenerationConfig.java65 symbols
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/DefaultGenerationConfig.java65 symbols
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/RuleFactory.java39 symbols
jsonschema2pojo-core/src/test/java/org/jsonschema2pojo/rules/TypeRuleTest.java38 symbols
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/TypeIT.java36 symbols
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/ConstructorsIT.java36 symbols
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/yaml/YamlTypeIT.java35 symbols
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/MediaIT.java30 symbols
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/util/Jsonschema2PojoRule.java28 symbols
jsonschema2pojo-integration-tests/src/test/java/org/jsonschema2pojo/integration/DefaultIT.java27 symbols

Dependencies from manifests, versioned

${project.groupId}:jsonschema2pojo-core
${project.groupId}:jsonschema2pojo-maven-plugin
com.beust:jcommander1.82 · 1×
com.fasterxml.jackson.core:jackson-annotations
com.fasterxml.jackson.dataformat:jackson-dataformat-yaml
com.fasterxml.jackson:jackson-bom
com.github.tomakehurst:wiremock-jre82.35.2 · 1×
com.google.code.findbugs:jsr3053.0.2 · 1×
com.google.code.javaparser:javaparser1.0.11 · 1×
com.squareup.moshi:moshi

For agents

$ claude mcp add jsonschema2pojo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact