public interface SchemaLibrary extends DocumentLibrary
Modifier and Type | Interface and Description |
---|---|
static interface |
SchemaLibrary.MismatchedTypeProblem
A special type of problem where a field value was not of the expected type, but where the field value could be converted to
the expected type
|
static interface |
SchemaLibrary.Problem |
static class |
SchemaLibrary.ProblemType |
static interface |
SchemaLibrary.Results
The results from a
validation . |
Modifier and Type | Method and Description |
---|---|
Document |
convertValues(Document document,
SchemaLibrary.Results results)
Look for fields within the document (including nested documents) whose values are not of the expected type for the given
schema, but whose values can be converted into the expected type.
|
Document |
convertValues(Document document,
String schemaUri)
Look for fields within the document (including nested documents) whose values are not of the expected type for the given
schema, but whose values can be converted into the expected type.
|
SchemaLibrary.Results |
validate(Document document,
String schemaUri)
Validate the supplied document against the JSON Schema with the supplied URI.
|
get, getAsync, getName, put, putAsync, putIfAbsent, putIfAbsentAsync, remove, removeAsync, replace, replaceAsync
SchemaLibrary.Results validate(Document document, String schemaUri)
document
- the document to be validated; may not be nullschemaUri
- the URI of the JSON Schema that should be used to validate the document; may not be nullDocument convertValues(Document document, SchemaLibrary.Results results)
This is often useful when the results from validate(Document, String)
contain only
mismatched type errors
. In such a case, the document can be converted and the
resulting document will likely satisfy the schema.
document
- the document to be validated; may not be nullresults
- the results from the validate(Document, String)
call; may not be nulldocument
if theDocument convertValues(Document document, String schemaUri)
This method is similar to convertValues(Document, Results)
, except that this method automatically runs a JSON
Schema validation to obtain the results. If you've already validated
the document, then
instead of calling this method (which would validate a second time) try calling convertValues(Document, Results)
.
document
- the document to be validated; may not be nullschemaUri
- the URI of the JSON Schema that should be used to validate the document; may not be nulldocument
if theCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.