document formats

This commit is contained in:
Kat Marchán 2021-08-31 12:02:32 -07:00
parent 1508ee4f13
commit 86f62aae47
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
2 changed files with 19 additions and 3 deletions

View File

@ -131,10 +131,26 @@ and property names when the `node-names` or `prop-names` options are activated.
#### String validations
* `pattern`: PCRE (Regex) pattern or patterns to test prop values against.
* `pattern`: Regex pattern or patterns to test prop values against. Specific regex syntax may be implementation-dependent.
* `min-length`: Minimum length, if a string.
* `max-length`: Maximum length, if a string.
* `format`: Intended data format, if the value is a string.
* `format`: Intended data format, if the value is a string. Possible values are:
* `date-time`: ISO8601 date/time format.
* `time`: "Time" section of ISO8601.
* `date`: "Date" section of ISO8601.
* `email`: RFC5302 email address.
* `idn-email`: RFC6531 internationalized email address.
* `hostname`: RFC1132 internet hostname.
* `idn-hostname`: RFC5890 internationalized internet hostname.
* `ipv4`: RFC2673 dotted-quad IPv4 address.
* `ipv6`: RFC2373 IPv6 address.
* `uri`: RFC3986 URI.
* `uri-reference`: RFC3986 URI Reference.
* `iri`: RFC3987 Internationalized Resource Identifier.
* `iri-reference`: RFC3987 Internationalized Resource Identifier Reference.
* `uri-template`: RFC6570 URI Template.
* `uuid`: RFC4122 UUID.
* `regex`: Regular expression. Specific patterns may be implementation-dependent.
#### Number validations

View File

@ -125,7 +125,7 @@ document description="KDL Schema KDL schema in KDL" schema-url="https://github.c
min 1
type "string"
// https://json-schema.org/understanding-json-schema/reference/string.html#format
enum "date-time" "date" "time" "email" "idn-email" "hostname" "ipv4" "ipv6" "uri" "uri-reference" "iri", "iri-reference" "uri-template" "kdl-pointer" "relative-kdl-pointer" "regex" "uuid"
enum "date-time" "date" "time" "email" "idn-email" "hostname" "idn-hostname" "ipv4" "ipv6" "uri" "uri-reference" "iri", "iri-reference" "uri-template" "regex" "uuid"
}
}
node "%" description="Only used for numeric values. Constrains them to be multiples of the given number(s)" {