toString

open override fun toString(): String

Formats the Scope to a valid JSON string for printing or using it inside Javascript.

Be aware that this is just a key-value formatting, where each payload data is just encoded as String. So there is no magical serialization for primitives or complex types embedded!

Examples:

// primitive types:
{
"boolean": "true"
"integer": "42"
}

// complex type
data class User(val name: String, val active: Boolean)
val key: keyOf<User>("user")
val user = User("Chris", true)
// as JSON
{
"user" : "User(name=Chris, active=true)"
}