Package-level declarations

Types

Link copied to clipboard
class JsonArray(values: List<JsonValue> = listOf()) : JsonValue, List<JsonValue>

Represents a JSON array

Link copied to clipboard
class JsonArrayBuilder(initialValues: List<JsonValue> = emptyList())

Builder class for creating JSON arrays in a structured and type-safe manner.

Link copied to clipboard
class JsonBoolean(val value: Boolean) : JsonValue

Represents a JSON boolean value

Link copied to clipboard
data object JsonNull : JsonValue

Represents a JSON null value

Link copied to clipboard
class JsonNumber(val value: Number) : JsonValue

Represents a JSON number value

Link copied to clipboard
class JsonObject(fields: Map<String, JsonValue> = mapOf()) : JsonValue, Map<String, JsonValue>

Represents a JSON object

Link copied to clipboard
class JsonObjectBuilder(initialFields: Map<String, JsonValue> = emptyMap())

Builder class for constructing JSON objects in a structured and type-safe way.

Link copied to clipboard
class JsonString(val value: String) : JsonValue

Represents a JSON string value

Link copied to clipboard
sealed interface JsonValue

JSON representation

Functions

Link copied to clipboard
fun jsonArray(initialValues: List<JsonValue> = emptyList(), builder: JsonArrayBuilder.() -> Unit): JsonArray

Creates a JsonArray using the given initial values and builder lambda.

Link copied to clipboard
fun jsonObject(initialFields: Map<String, JsonValue> = emptyMap(), builder: JsonObjectBuilder.() -> Unit): JsonObject

Creates a new JsonObject using the provided initial fields and a lambda for adding or modifying fields. This function is part of a DSL for building JSON objects in a structured and type-safe way.