Package-level declarations

Types

Link copied to clipboard
abstract class JsonApiResourceDeserializer<T>(serialName: String) : DeserializationStrategy<T>

Base deserializer for JSON:API resource objects.

Functions

Link copied to clipboard
fun JsonObject.optionalArray(key: String): JsonArray?

Returns the nested JsonArray for the given key, or null when the key is absent or the value is not an array.

Link copied to clipboard

Returns the Boolean value for the given key, or null when the key is absent, the value is JsonNull, or not a primitive.

Link copied to clipboard

Returns the Double value for the given key, or null when the key is absent, the value is JsonNull, or not a primitive.

Link copied to clipboard
fun JsonObject.optionalInt(key: String): Int?

Returns the Int value for the given key, or null when the key is absent, the value is JsonNull, or not a primitive.

Link copied to clipboard
fun JsonObject.optionalObject(key: String): JsonObject?

Returns the nested JsonObject for the given key, or null when the key is absent or the value is not an object.

Link copied to clipboard

Returns the String value for the given key, or null when the key is absent, the value is JsonNull, or not a primitive.

Link copied to clipboard
fun JsonObject.requiredArray(key: String): JsonArray

Returns the nested JsonArray for the given key, or throws SerializationException if the key is missing or not an object.

Link copied to clipboard

Returns the Boolean value for the given key, or throws SerializationException if the key is missing or null.

Link copied to clipboard

Returns the Double value for the given key, or throws SerializationException if the key is missing or null.

Link copied to clipboard
fun JsonObject.requiredInt(key: String): Int

Returns the Int value for the given key, or throws SerializationException if the key is missing or null.

Link copied to clipboard
fun JsonObject.requiredObject(key: String): JsonObject

Returns the nested JsonObject for the given key, or throws SerializationException if the key is missing or not an object.

Link copied to clipboard

Returns the String value for the given key, or throws SerializationException if the key is missing or null.

Link copied to clipboard

Asserts that the JSON:API resource id is present, smart-casting it to String at the call site via a Kotlin Contract.

Link copied to clipboard
fun requireIncluded(included: JsonArray?)

Asserts that a JSON:API resource has a non-null included object.

Link copied to clipboard
fun requireRelationships(relationships: JsonObject?)

Asserts that a JSON:API resource has a non-null relationships object.