public class DurationValidator extends BaseJsonValidator
This validator will enforce the strict definition of RFC 3339 unless
SchemaValidatorsConfig.isStrict()
return false.
JSON Schema Draft 2019-09 and later uses RFC 3339 to define dates and times. RFC 3339 bases its definition of duration of what is in the 1988 version of ISO 1801, which is over 35 years old and has undergone many changes with updates in 1991, 2000, 2004, 2019 and an amendment in 2022.
There are notable differences between the current version of ISO 8601 and RFC 3339:
There are notable differences in how RFC 3339 defines a duration compared with how the Java Date/Time API defines it:
applyDefaultsStrategy, failFast, parentSchema, schemaNode, schemaPath, validationContext
Constructor and Description |
---|
DurationValidator(String schemaPath,
com.fasterxml.jackson.databind.JsonNode schemaNode,
JsonSchema parentSchema,
ValidationContext validationContext,
String formatName,
ValidatorTypeCode type) |
Modifier and Type | Method and Description |
---|---|
Set<ValidationMessage> |
validate(com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode rootNode,
String at)
Validate the given JsonNode, the given node is the child node of the root node at given
data path.
|
atPath, atPath, atRoot, buildValidationMessage, checkDiscriminatorMatch, constructValidationMessage, debug, equals, fetchSubSchemaNode, getNodeFieldType, getParentSchema, getPathType, getSchemaNode, getSchemaPath, getValidatorType, greaterThan, isPartOfOneOfMultipleType, lessThan, parseErrorCode, preloadJsonSchemas, registerAndMergeDiscriminator, validate, walk
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
preloadJsonSchema
public DurationValidator(String schemaPath, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, ValidationContext validationContext, String formatName, ValidatorTypeCode type)
public Set<ValidationMessage> validate(com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode rootNode, String at)
JsonValidator
node
- JsonNoderootNode
- JsonNodeat
- StringCopyright © 2023. All rights reserved.