The jsonapi request context
In every request, a JsonApiContext object is created containing many practical informations.
{
koaContext : RouterContext,
query?: QueryParser<TModel>,
method: JsonApiMethod,
currentUser?: unknown,
resource: ResourceMeta<TModel, TResource>,
}
- The Koa context
- The query parser
- The current jsonapi method (GET/CREATE/UPDATE/...)
- The current user for the request
- The resource binded to this context
This object can be accessed in :
- resources
- controllers (via parameter decorators)
- deserializers
- serializers
- query parsers