fromResource

fun fromResource(resource: JsonObject, included: JsonArray? = null): T

Deserializes a single resource JsonObject with optional included context.

This is the primary entry point used by HttpResponse extension functions. It extracts id, attributes, and relationships from resource and delegates to deserializeResource.

Parameters

resource

A JSON:API resource object (the content of a "data" field).

included

The root-level "included" array, shared across all resources in a response. Pass null when the response has no side-loaded data.