Java JSON Schema Generator: https://github.com/victools/jsonschema-generator

Creates JSON Schema (Draft 6, Draft 7 or Draft 2019-09) from Java classes using Jackson.

Answer from Edgar Domingues on Stack Overflow
🌐
Jsonschema2pojo
jsonschema2pojo.org
jsonschema2pojo
Generate Plain Old Java Objects from JSON or JSON-Schema. ... For each property present in the 'properties' definition, we add a property to a given Java class according to the JavaBeans spec.
🌐
GitHub
github.com › joelittlejohn › jsonschema2pojo
GitHub - joelittlejohn/jsonschema2pojo: Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc · GitHub
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.
🌐
JetBrains
plugins.jetbrains.com › plugin › 13733-pojo-to-json-schema
POJO to JSON Schema - IntelliJ IDEs Plugin | Marketplace
Generates JSON Schemas from Java classes. Generated json schemas locates under .generated-json-schemas folder. How to use Right click on Java class: Click POJO to JSON...
🌐
GeeksforGeeks
geeksforgeeks.org › advance java › generate-model-classes-using-jsonschema2pojo-website-and-maven-dependency-for-a-spring-boot-project-that-consumes-api
Generate Model Classes using jsonSchema2Pojo (website and Maven Dependency) For a Spring Boot Project That Consumes API - GeeksforGeeks
July 23, 2025 - 2. Generate the Classes: Visits the jsonSchema2Pojo. Paste the schema into the input area. Configure the options like package, Source Type and their output format. Then click the preview or Download to see the generated the Java code.
🌐
GitHub
github.com › whsoul › json-schema-pojo
GitHub - whsoul/json-schema-pojo · GitHub
Create automatically generate with 3rd party POJO to Json schema library below Reference(#1) ( or Create jsonSchema Structure by your self)
Author: whsoul
🌐
Stack Overflow
stackoverflow.com › questions › 64348860 › pojo-to-json-schema
java - Pojo to Json Schema - Stack Overflow
October 14, 2020 - My question is how do i change my Java pojo object so it can generate the schema like below · { "$id": "test id", "$schema": "http://json-schema.org/draft-07/schema", "title": "Test title", "description": "test description", "type": "object", "properties": { "name": { "$ref": "#/definitions/d_NonZeroLengthString" } }, "definitions": { "d_NonZeroLengthString": { "description": "Non Zero Length String", "type": "string", "minLength": 1 } } } ... @OneCricketeer because i am not able to ...
🌐
Baeldung
baeldung.com › home › json › generate a java class from json
Generate a Java Class From JSON | Baeldung
May 11, 2024 - We can also achieve all of this by simply visiting jsonschema2pojo.org. The jsonschema2pojo tool takes a JSON (or YAML) schema document and generates DTO-style Java classes.
Find elsewhere
🌐
AWS
docs.aws.amazon.com › aws glue › user guide › data discovery and cataloging in aws glue › aws glue schema registry › getting started with schema registry › installing serde libraries › creating a registry › dealing with a specific record (java pojo) for json
Dealing with a specific record (JAVA POJO) for JSON - AWS Glue
You can use a plain old Java object (POJO) and pass the object as a record. This is similar to the notion of a specific record in AVRO. The mbknor-jackson-jsonschema can generate a JSON schema for the POJO passed. This library can also inject additional information in the JSON schema.
🌐
Gradle
plugins.gradle.org › plugin › org.jsonschema2pojo
Gradle - Plugin: org.jsonschema2pojo
February 8, 2026 - Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, and more. ... Adding the plugin to build logic for usage in precompiled script plugins.
🌐
Jamie Tanna
jvt.me › posts › 2021 › 11 › 29 › gradle-json-schema
Generate Plain Old Java Objects (POJOs) from JSON Schema Definitions with Gradle · Jamie Tanna | Software Engineer
November 29, 2021 - This will be stored in the location src/main/resources/schema/data.json. There are then two options for how we want to generate the POJOs.
🌐
olajson
olajson.com › jsonschema2pojo
Generate JSON Schema2pojo Online for Free
Try jsonschema2pojo online or brew install jsonschema2pojo. Generate Java types from JSON or JSON Schema and annotate those types for data-binding
Rating: 5 ​ - ​ 1 votes
Top answer
1 of 1
1

You can use Jackson to generate the JSON schema using the following maven dependencies

<dependency>
 <groupId>com.fasterxml.jackson.core</groupId>
 <artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
</dependency>
<dependency>
 <groupId>com.fasterxml.jackson.module</groupId>
 <artifactId>jackson-module-jsonSchema</artifactId>
 <version>2.9.8</version>
</dependency>
<dependency>
 <groupId>org.reflections</groupId>
 <artifactId>reflections</artifactId>
 <version>0.9.11</version>
</dependency>

You can then generate the schema by writing something like this

public static void main(String[] args) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    JsonSchemaGenerator schemaGen = new JsonSchemaGenerator(mapper);

    Reflections reflections = new Reflections("my.pojo.model",new SubTypesScanner(false));
    Set<Class<?>> pojos = reflections.getSubTypesOf(Object.class);
    Map<String, String> schemaByClassNameMap = pojos.stream()
            .collect(Collectors.toMap(Class::getSimpleName, pojo -> getSchema(mapper, schemaGen, pojo)));
    schemaByClassNameMap.entrySet().forEach(schemaByClassNameEntry->writeToFile(schemaByClassNameEntry.getKey(),schemaByClassNameEntry.getValue()));

}

private static void writeToFile(String pojoClassName, String pojoJsonSchema) {
    try {
        Path path = Paths.get(pojoClassName + ".json");
        Files.deleteIfExists(path);
        byte[] strToBytes = pojoJsonSchema.getBytes();
        Files.write(path, strToBytes);
    }catch (Exception e){
        throw new IllegalStateException(e);
    }
}

private static String getSchema(ObjectMapper mapper,JsonSchemaGenerator schemaGenerator,Class clazz){
    try {
        JsonSchema schema = schemaGenerator.generateSchema(clazz);
        return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema);
    }catch (Exception e){
        throw new IllegalStateException(e);
    }
}
🌐
Google Groups
groups.google.com › g › jsonschema2pojo-users › c › tSx7YvExaoQ
how to configure generate pojos from schema
Hi Joe, Yes ! thank you for the example, very easy to override default properties. I am using $ref in the json schema for a few objects, example "requestor", "shipper", "consignee" all "$ref" : "#/definitions/facility" ... The online version generates objects for all three.
🌐
Google Groups
groups.google.com › g › json-schema › c › 4Yov_H73syo
POJO to JSON schema
Does anyone know any open project, which converts POJO to JSON schema (v4 format)? I found this project: https://github.com/reinert/JJSchema · But it doesn't work with gradle. Thanks. unread, Apr 1, 2014, 1:26:50 AM4/1/14 ·  ·  ·  · Reply to author ·
Starred by 2 users
Forked by 2 users
Languages: Java 100.0% | Java 100.0%
🌐
YouTube
youtube.com › cottrell coding
Create Java Class from JSON using jsonschema2pojo - YouTube
Using JSON in Java usually requires creating a class to match the JSON structure. While class creation is not hard, this tool will streamline the process.We ...
Published: November 17, 2021
Views: 4K
Author: FasterXML
🌐
Medium
medium.com › @samjingwen › generate-pojos-from-json-schema-with-gradle-37d88867aabb
Generate POJOs From JSON Schema With Gradle | by Sam Jing Wen | Medium
June 10, 2024 - Generate POJOs From JSON Schema With Gradle Introduction In this article, we will demonstrate how to generate Java classes, also called POJOs, using JSON files. This is made easier by using a handy …
🌐
YouTube
youtube.com › watch
Generating POJO Classes from JSON Schema Within 1 Sec | RoboPOJOGenerator|Json2Pojo |Koding Hub - YouTube
Generating POJO classes from Complex or Nested JSON schema within 1 Sec. Generates Java, Java Records and Kotlin POJO files from JSON: GSON, FastJSON, AutoVa...
Published: March 26, 2022