Class JsonSchema
java.lang.Object
io.confluent.kafka.schemaregistry.json.JsonSchema
- All Implemented Interfaces:
ParsedSchema
-
Field Summary
FieldsFields inherited from interface io.confluent.kafka.schemaregistry.ParsedSchema
RESERVED -
Constructor Summary
ConstructorsConstructorDescriptionJsonSchema(com.fasterxml.jackson.databind.JsonNode jsonNode) JsonSchema(com.fasterxml.jackson.databind.JsonNode jsonNode, List<SchemaReference> references, Map<String, String> resolvedReferences, Metadata metadata, RuleSet ruleSet, Integer version) JsonSchema(com.fasterxml.jackson.databind.JsonNode jsonNode, List<SchemaReference> references, Map<String, String> resolvedReferences, Integer version) JsonSchema(String schemaString) JsonSchema(String schemaString, List<SchemaReference> references, Map<String, String> resolvedReferences, Metadata metadata, RuleSet ruleSet, Integer version) JsonSchema(String schemaString, List<SchemaReference> references, Map<String, String> resolvedReferences, Metadata metadata, RuleSet ruleSet, Integer version, boolean blockRemoteRefs) JsonSchema(String schemaString, List<SchemaReference> references, Map<String, String> resolvedReferences, Integer version) JsonSchema(org.everit.json.schema.Schema schemaObj) JsonSchema(org.everit.json.schema.Schema schemaObj, Integer version) -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(Map<SchemaEntity, Set<String>> tagsToAdd, Map<SchemaEntity, Set<String>> tagsToRemove) copy(Map<SchemaEntity, Set<String>> tagsToAdd, Map<SchemaEntity, Set<String>> tagsToRemove, boolean addBeforeRemove) copyMessage(Object message) booleanformattedString(String format) fromJson(com.fasterxml.jackson.databind.JsonNode json) booleaninthashCode()booleanhasTopLevelField(String field) isBackwardCompatible(CompatibilityPolicy policy, ParsedSchema previousSchema) isBackwardCompatible(ParsedSchema previousSchema) booleanmetadata()name()org.everit.json.schema.SchemaruleSet()com.fasterxml.jackson.databind.JsonNodecom.fasterxml.jackson.databind.JsonNodetoString()transformMessage(RuleContext ctx, FieldTransform transform, Object message) voidvalidate(boolean strict) com.fasterxml.jackson.databind.JsonNodevalidate(com.fasterxml.jackson.databind.JsonNode value) static com.fasterxml.jackson.databind.JsonNodevalidate(com.github.erosb.jsonsKema.Schema schema, com.fasterxml.jackson.databind.JsonNode value) static com.fasterxml.jackson.databind.JsonNodevalidateMessage(ValidationRuleExecutor executor, Object message) Walkmessageagainst this schema and evaluate every inlineconfluent:rulesCHECK constraint encountered, collecting all failures into the returned list.validateMessage(ValidationRuleExecutor executor, Object message, boolean failFast) version()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.ParsedSchema
canLookup, deepEquals, equivalent, getReservedFields, isCompatible, isCompatible, tags, validate
-
Field Details
-
DEFAULT_BASE_URI
- See Also:
-
TYPE
- See Also:
-
TAGS
- See Also:
-
-
Constructor Details
-
JsonSchema
public JsonSchema(com.fasterxml.jackson.databind.JsonNode jsonNode) -
JsonSchema
-
JsonSchema
-
JsonSchema
-
JsonSchema
-
JsonSchema
-
JsonSchema
-
JsonSchema
public JsonSchema(org.everit.json.schema.Schema schemaObj) -
JsonSchema
-
-
Method Details
-
copy
- Specified by:
copyin interfaceParsedSchema
-
copy
- Specified by:
copyin interfaceParsedSchema
-
copy
- Specified by:
copyin interfaceParsedSchema
-
copy
public ParsedSchema copy(Map<SchemaEntity, Set<String>> tagsToAdd, Map<SchemaEntity, Set<String>> tagsToRemove) - Specified by:
copyin interfaceParsedSchema
-
copy
public ParsedSchema copy(Map<SchemaEntity, Set<String>> tagsToAdd, Map<SchemaEntity, Set<String>> tagsToRemove, boolean addBeforeRemove) - Specified by:
copyin interfaceParsedSchema
-
copyIgnoringModernDialects
-
toJsonNode
public com.fasterxml.jackson.databind.JsonNode toJsonNode() -
rawSchema
public org.everit.json.schema.Schema rawSchema()- Specified by:
rawSchemain interfaceParsedSchema
-
getPrepopulatedMappings
-
hasTopLevelField
- Specified by:
hasTopLevelFieldin interfaceParsedSchema
-
schemaType
- Specified by:
schemaTypein interfaceParsedSchema
-
name
- Specified by:
namein interfaceParsedSchema
-
has
-
getString
-
canonicalString
- Specified by:
canonicalStringin interfaceParsedSchema
-
formattedString
- Specified by:
formattedStringin interfaceParsedSchema
-
version
- Specified by:
versionin interfaceParsedSchema
-
references
- Specified by:
referencesin interfaceParsedSchema
-
resolvedReferences
-
metadata
- Specified by:
metadatain interfaceParsedSchema
-
ruleSet
- Specified by:
ruleSetin interfaceParsedSchema
-
isIgnoreModernDialects
public boolean isIgnoreModernDialects() -
normalize
- Specified by:
normalizein interfaceParsedSchema
-
validate
public void validate(boolean strict) - Specified by:
validatein interfaceParsedSchema
-
validate
public com.fasterxml.jackson.databind.JsonNode validate(com.fasterxml.jackson.databind.JsonNode value) throws com.fasterxml.jackson.core.JsonProcessingException, org.everit.json.schema.ValidationException - Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionorg.everit.json.schema.ValidationException
-
validate
public static com.fasterxml.jackson.databind.JsonNode validate(com.github.erosb.jsonsKema.Schema schema, com.fasterxml.jackson.databind.JsonNode value) throws com.fasterxml.jackson.core.JsonProcessingException, org.everit.json.schema.ValidationException - Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionorg.everit.json.schema.ValidationException
-
validate
public static com.fasterxml.jackson.databind.JsonNode validate(org.everit.json.schema.Schema schema, Object value) throws com.fasterxml.jackson.core.JsonProcessingException, org.everit.json.schema.ValidationException - Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionorg.everit.json.schema.ValidationException
-
isBackwardCompatible
- Specified by:
isBackwardCompatiblein interfaceParsedSchema
-
isBackwardCompatible
- Specified by:
isBackwardCompatiblein interfaceParsedSchema
-
equals
-
hashCode
public int hashCode() -
toString
-
fromJson
- Specified by:
fromJsonin interfaceParsedSchema
-
toJson
- Specified by:
toJsonin interfaceParsedSchema- Throws:
IOException
-
copyMessage
- Specified by:
copyMessagein interfaceParsedSchema- Throws:
IOException
-
transformMessage
public Object transformMessage(RuleContext ctx, FieldTransform transform, Object message) throws RuleException - Specified by:
transformMessagein interfaceParsedSchema- Throws:
RuleException
-
validateMessage
Walkmessageagainst this schema and evaluate every inlineconfluent:rulesCHECK constraint encountered, collecting all failures into the returned list. Read-only — does not modify the message.Two kinds of rules are evaluated:
- Object-level (
confluent:ruleson anObjectSchema) —this= the object value. - Property-level (
confluent:ruleson a property's schema) —this= the property value. Honors the column-level skip-on-null contract: when the property value isnull(or the property is absent), property-level rules are skipped.
Failures are appended to the returned list with their dotted-path location (e.g.
$.addr.zip,$.tags[3]). The walk continues after each failure so callers see the full set rather than only the first.- Specified by:
validateMessagein interfaceParsedSchema
- Object-level (
-
validateMessage
public List<ValidationRuleError> validateMessage(ValidationRuleExecutor executor, Object message, boolean failFast) - Specified by:
validateMessagein interfaceParsedSchema
-
inlineTags
- Specified by:
inlineTagsin interfaceParsedSchema
-
inlineTaggedEntities
- Specified by:
inlineTaggedEntitiesin interfaceParsedSchema
-