| Class | Description |
|---|---|
| AbstractDateFormatSpecifier |
Specialized format validator for date/time checking
|
| DateTimeFormatSpecifier |
Validator for the
date-time format specification |
| EmailFormatSpecifier |
Validator for the
email format specification. |
| FormatBundle |
A format specifiers bundle
|
| FormatSpecifier |
Base class for a format specifier
|
| HostnameFormatSpecifier |
Validator for the
host-name format specification |
| IPV4FormatSpecifier |
Validator for the
ip-address format specification, ie an IPv4 address |
| IPV6FormatSpecifier |
Validator for the
ipv6 format specification |
| RegexFormatSpecifier |
Validator for the
regex format specification |
| URIFormatSpecifier |
Validator for the
uri format specification |
The format keyword is defined by section 5.23 of the current
draft. This particular package supports the following format specifiers:
date-time;email;host-name;ip-address;ipv6;regex;uri.All other format specifiers defined by the draft (except color and
style, for which support is deliberately omitted) are now in a
separate package: json-schema-formats
.
In addition to using the package above, you can also implement your own
format specifiers by creating a FormatBundle and setting/merging your
bundle into your schema factory. See also FormatSpecifier.
Note: by default, the host-name and email format
specifiers require that both validated values have a domain part. This
contradicts what the respective RFCs say, but it is more in line with user
expectations. You can tell these formats to strictly comply to the RFC by
setting ValidationFeature.STRICT_RFC_CONFORMANCE
when building your schema factory (see JsonSchemaFactory.Builder.enableFeature(org.eel.kitchen.jsonschema.main.ValidationFeature)).
Copyright © 2012. All Rights Reserved.