1 package com.fasterxml.jackson.databind.jsonschema; 2 3 import com.fasterxml.jackson.databind.JsonNode; 4 import com.fasterxml.jackson.databind.JsonMappingException; 5 import com.fasterxml.jackson.databind.SerializerProvider; 6 7 import java.lang.reflect.Type; 8 9 /** 10 * Marker interface for schema-aware serializers. 11 */ 12 public interface SchemaAware 13 { 14 /** 15 * Get the representation of the schema to which this serializer will conform. 16 * 17 * @param provider The serializer provider. 18 * @param typeHint A hint about the type. 19 * @return <a href="http://json-schema.org/">Json-schema</a> for this serializer. 20 */ getSchema(SerializerProvider provider, Type typeHint)21 public JsonNode getSchema(SerializerProvider provider, Type typeHint) 22 throws JsonMappingException; 23 24 /** 25 * Get the representation of the schema to which this serializer will conform. 26 * 27 * @param provider The serializer provider. 28 * @param isOptional Is the type optional 29 * @param typeHint A hint about the type. 30 * @return <a href="http://json-schema.org/">Json-schema</a> for this serializer. 31 */ getSchema(SerializerProvider provider, Type typeHint, boolean isOptional)32 public JsonNode getSchema(SerializerProvider provider, Type typeHint, boolean isOptional) 33 throws JsonMappingException; 34 } 35