Class JsonSchemaGenerator
- java.lang.Object
-
- com.fasterxml.jackson.module.jsonSchema.jakarta.JsonSchemaGenerator
-
public class JsonSchemaGenerator extends java.lang.Object
Convenience class that wraps JSON Schema generation functionality.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.ObjectMapper
_mapper
Deprecated.Since 2.6private SchemaFactoryWrapper
_visitor
private WrapperFactory
_wrapperFactory
protected com.fasterxml.jackson.databind.ObjectWriter
_writer
-
Constructor Summary
Constructors Constructor Description JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectMapper mapper)
JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectMapper mapper, SchemaFactoryWrapper visitor)
NOTE: resulting generator is NOT thread-safe, since typicallySchemaFactoryWrapper
being passed is not thread-safe.JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectMapper mapper, WrapperFactory wrapperFactory)
JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectWriter w)
JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectWriter w, SchemaFactoryWrapper visitor)
JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectWriter w, WrapperFactory wrapperFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonSchema
generateSchema(com.fasterxml.jackson.databind.JavaType type)
JsonSchema
generateSchema(java.lang.Class<?> type)
-
-
-
Field Detail
-
_mapper
@Deprecated protected final com.fasterxml.jackson.databind.ObjectMapper _mapper
Deprecated.Since 2.6
-
_writer
protected final com.fasterxml.jackson.databind.ObjectWriter _writer
- Since:
- 2.6
-
_wrapperFactory
private final WrapperFactory _wrapperFactory
-
_visitor
private final SchemaFactoryWrapper _visitor
- Since:
- 2.8.1
-
-
Constructor Detail
-
JsonSchemaGenerator
public JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
JsonSchemaGenerator
public JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectMapper mapper, WrapperFactory wrapperFactory)
-
JsonSchemaGenerator
public JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectMapper mapper, SchemaFactoryWrapper visitor)
NOTE: resulting generator is NOT thread-safe, since typicallySchemaFactoryWrapper
being passed is not thread-safe.- Since:
- 2.8.1
-
JsonSchemaGenerator
public JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectWriter w)
- Since:
- 2.6
-
JsonSchemaGenerator
public JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectWriter w, WrapperFactory wrapperFactory)
- Since:
- 2.6
-
JsonSchemaGenerator
public JsonSchemaGenerator(com.fasterxml.jackson.databind.ObjectWriter w, SchemaFactoryWrapper visitor)
- Since:
- 2.8.1
-
-
Method Detail
-
generateSchema
public JsonSchema generateSchema(java.lang.Class<?> type) throws com.fasterxml.jackson.databind.JsonMappingException
- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
generateSchema
public JsonSchema generateSchema(com.fasterxml.jackson.databind.JavaType type) throws com.fasterxml.jackson.databind.JsonMappingException
- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
-