DirectiveArgs

A directive occurrence's arguments — all verbatim (unresolved). Resolve what you need through DirectiveContext; an argument nobody resolves is never evaluated.

The coercion helpers apply the standard error contract: only null data degrades (boolean of null is false, array of null is empty), everything else present-but-wrong fails loud with the typed identity.

Properties

Link copied to clipboard

The marker, e.g. "$if" — used to label coercion errors.

Link copied to clipboard
val primary: <Error class: unknown class>

The marker key's value, verbatim.

Functions

Link copied to clipboard
fun array(value: <Error class: unknown class>): List<<Error class: unknown class>>

null → empty list; a JSON array → its elements; anything else → notAList.

Link copied to clipboard
fun boolean(value: <Error class: unknown class>): Boolean

nullfalse; a real JSON boolean → itself; anything else → notABoolean.

Link copied to clipboard
fun obj(value: <Error class: unknown class>): Map<String, <Error class: unknown class>>

A JSON object → its entries; anything else, including nullnotAnObject.

Link copied to clipboard
fun option(name: String): <Error class: unknown class>?

The named option, verbatim; Kotlin null when absent (authored null is JsonNull).

Link copied to clipboard
fun require(name: String): <Error class: unknown class>

The named option, verbatim; absent → missingOption.

Link copied to clipboard
fun string(value: <Error class: unknown class>): String

A JSON string → itself; anything else, including nullnotAString.