InvalidValue

class InvalidValue(val path: String, val raw: Any?, val expected: String, val hint: String? = null) : ConfigError

A value was present but could not be converted to the expected type.

Generated by Deserializer when a YAML value (or environment variable string) cannot be coerced to the target Kotlin type, or when an enum constant is not recognised.

Example - a non-numeric string where an Int is expected:

port: "not_a_number"

produces: InvalidValue(path = "server.port", raw = "not_a_number", expected = "Int")

Since

1.0

Parameters

path

Dot-separated field path.

raw

The original value from the YAML map (may be null).

expected

Human-readable description of the expected type or value set.

hint

Optional contextual hint (e.g. "did you mean 'INFO'?").

Constructors

Link copied to clipboard
constructor(path: String, raw: Any?, expected: String, hint: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val hint: String? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val raw: Any?