fromJson

fun KbEnvironment.Companion.fromJson(json: String, clock: Clock = Clock.System, configure: KbEnvironmentBuilder.() -> Unit = {}): KbEnvironment(source)

Creates a new KbEnvironment by parsing json as a JSON object, bridging it to a KpaStruct via asKpaStruct, and using the struct as the context.

Return

a new KbEnvironment.

Parameters

json

the JSON string; must parse to a JSON object.

clock

the clock used to seed the default now environment property; defaults to Clock.System.

configure

a DSL lambda for registering transforms and properties on the environment.

Throws

if json does not parse to a JSON object.