validate.StringRules
Example
Disclaimer: The example is meant to show what methods are available on the object and does not necessarily constitute working
code.
local types = import 'types.libsonnet';
types.validate.StringRules
.withAddress(false)
.withConst('string')
.withContains('string')
.withEmail(false)
.withHostname(false)
.withIgnoreEmpty(false)
.withIn([ 'string' ])
.withIp(false)
.withIpv4(false)
.withIpv6(false)
.withLen(1)
.withLenBytes(1)
.withMaxBytes(1)
.withMaxLen(1)
.withMinBytes(1)
.withMinLen(1)
.withNotContains('string')
.withNotIn([ 'string' ])
.withPattern('string')
.withPrefix('string')
.withStrict(false)
.withSuffix('string')
.withUri(false)
.withUriRef(false)
.withUuid(false)
.withWellKnownRegex(types.validate.KnownRegex.UNKNOWN)
._validate()
Fields
Name |
Type |
One-of group |
Required |
Constraints |
address |
bool
|
well_known |
|
|
const |
string
|
|
|
|
contains |
string
|
|
|
|
email |
bool
|
well_known |
|
|
hostname |
bool
|
well_known |
|
|
ignore_empty |
bool
|
|
|
|
in |
[]
string
|
|
|
|
ip |
bool
|
well_known |
|
|
ipv4 |
bool
|
well_known |
|
|
ipv6 |
bool
|
well_known |
|
|
len |
uint64
|
|
|
|
len_bytes |
uint64
|
|
|
|
max_bytes |
uint64
|
|
|
|
max_len |
uint64
|
|
|
|
min_bytes |
uint64
|
|
|
|
min_len |
uint64
|
|
|
|
not_contains |
string
|
|
|
|
not_in |
[]
string
|
|
|
|
pattern |
string
|
|
|
|
prefix |
string
|
|
|
|
strict |
bool
|
|
|
|
suffix |
string
|
|
|
|
uri |
bool
|
well_known |
|
|
uri_ref |
bool
|
well_known |
|
|
uuid |
bool
|
well_known |
|
|
well_known_regex |
validate.KnownRegex
|
well_known |
|
|