Registry / serialization / jackson-module-jsonschema

jackson-module-jsonschema

JSON →
library2.22.0javamavenunverified

Add-on module for Jackson to generate JSON Schema (draft-03) from Java classes.

<dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jsonSchema</artifactId> <version>2.22.0</version> </dependency>
INSTALL
IMPORT
SIG · JACKSON-MODULE-JSO
J
jackson-module-jsonschema
serializationjavav2.22.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

JsonSchemaGenerator
com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator

Generates a JSON Schema for the String class.

import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.module.jsonSchema.JsonSchema; import com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator; public class Main { public static void main(String[] args) throws Exception { ObjectMapper mapper = new ObjectMapper(); JsonSchemaGenerator schemaGen = new JsonSchemaGenerator(mapper); JsonSchema schema = schemaGen.generateSchema(String.class); System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(schema)); } }
Debug
Known issues
gotchaThis module generates JSON Schema draft-03, which is outdated. Consider using a newer draft or library.
fix
Use jackson-module-jsonSchema for draft-03 or switch to a library supporting later drafts like draft-07 or 2020-12.
affects: all
Upgrade
Version history
2.22.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
Resources
jackson-module-jsonschema — mvn dependency:get jackson-module-jsonschema · libregistry