Class ValidationMessageAdapter
java.lang.Object
io.micronaut.jsonschema.validation.ValidationMessageAdapter
- All Implemented Interfaces:
ValidationMessage
- Direct Known Subclasses:
NetworkNtValidationMessage
The
ValidationMessage implementation of the JsonSchemaValidator implementations. It carries the
details of an error: the messages of the NetworkNT based validator are a subclass that also gives access to the
NetworkNT error (NetworkNtValidationMessage, in micronaut-json-schema-validator-networknt). Prior to
2.3.2 this type wrapped the NetworkNT com.networknt.schema.Error.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorsConstructorDescriptionValidationMessageAdapter(String instanceLocation, String keyword, String schemaLocation, String detail) Creates a validation message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the message without the instance location.Returns the location of the invalid value.Returns the keyword that failed.Returns the validation message.Returns the location of the failing keyword in the schema.toString()
-
Constructor Details
-
ValidationMessageAdapter
public ValidationMessageAdapter(String instanceLocation, String keyword, String schemaLocation, String detail) Creates a validation message.- Parameters:
instanceLocation- The JSON Pointer of the invalid instance locationkeyword- The keyword that failedschemaLocation- The absolute location of the keyword in the schemadetail- The message, without the instance location- Since:
- 2.3.2
-
-
Method Details
-
getMessage
Description copied from interface:ValidationMessageReturns the validation message.- Specified by:
getMessagein interfaceValidationMessage- Returns:
- JSON Schema Validation Message, prefixed with the JSON Pointer of the invalid instance location
-
getInstanceLocation
Description copied from interface:ValidationMessageReturns the location of the invalid value.- Specified by:
getInstanceLocationin interfaceValidationMessage- Returns:
- The JSON Pointer (RFC 6901) of the instance location that failed validation, empty for the root
-
getKeyword
Description copied from interface:ValidationMessageReturns the keyword that failed.- Specified by:
getKeywordin interfaceValidationMessage- Returns:
- The JSON Schema keyword that failed validation, if known
-
getSchemaLocation
Description copied from interface:ValidationMessageReturns the location of the failing keyword in the schema.- Specified by:
getSchemaLocationin interfaceValidationMessage- Returns:
- The location of the failing keyword within the schema (the base URI of the schema plus a JSON Pointer fragment), if known. It is absolute when the schema has an absolute base URI
-
getDetail
Returns the message without the instance location.- Returns:
- The message without the instance location prefix
- Since:
- 2.3.2
-
toString
-