JsonApiResourceDeserializer
Base deserializer for JSON:API resource objects.
Every resource in the PUBG JSON:API follows the same envelope:
{
"type": "player",
"id": "account.abc123",
"attributes": { … },
"relationships": { … }
}Content copied to clipboard
Subclasses only need to implement deserializeResource to map the pre-parsed id, attributes, relationships, and included into the domain model.
Example
internal object PlayerSerializer : JsonApiResourceDeserializer<Player>("pubgkt.Player") {
override fun deserializeResource(
attributes: JsonObject, id: String, relationships: JsonObject?, included: JsonArray?,
) = Player(id = id, name = attributes.requiredString("name"), …)
}Content copied to clipboard
Parameters
serialName
Unique descriptor name, conventionally the fully-qualified class name of the target type (e.g. "pubgkt.Player").
Functions
Link copied to clipboard
DeserializationStrategy entry point.
Link copied to clipboard
Deserializes a single resource JsonObject with optional included context.