PatternMismatch

class PatternMismatch(val path: String, val raw: String, val pattern: String, val description: String? = null) : ConfigError

A string value does not match the regex declared by the @Pattern annotation.

Generated during post-deserialization validation. Like OutOfRange, the deserializer falls back to the Kotlin default when one is available.

Example:

data class Network(@Pattern(regex = "^(https?://).+") val endpoint: String = "http://localhost")

With YAML endpoint: "ftp://files":

PatternMismatch(path = "network.endpoint", raw = "ftp://files", pattern = "^(https?://).+")

Since

1.0

Parameters

path

Dot-separated field path.

raw

The string value that failed validation.

pattern

The regex pattern that was expected to match.

description

Optional human-readable description from the annotation.

Constructors

Link copied to clipboard
constructor(path: String, raw: String, pattern: String, description: String? = null)

Properties

Link copied to clipboard
val description: String? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val raw: String