Interface IJsonApiRequest
- Namespace
- JsonApiDotNetCore.Middleware
- Assembly
- JsonApiDotNetCore.dll
Metadata associated with the JSON:API request that is currently being processed.
public interface IJsonApiRequest
Properties
Extensions
The JSON:API extensions enabled for the current request. This is always a subset of Extensions.
IReadOnlySet<JsonApiMediaTypeExtension> Extensions { get; }
Property Value
IsCollection
Indicates whether this request targets a single resource or a collection of resources.
bool IsCollection { get; }
Property Value
IsReadOnly
Indicates whether this request targets only fetching of data (resources and relationships), as opposed to applying changes.
bool IsReadOnly { get; }
Property Value
Kind
Routing information, based on the path of the request URL.
EndpointKind Kind { get; }
Property Value
PrimaryId
The ID of the primary resource for this request. This would be null
in "/blogs", "123" in "/blogs/123" or "/blogs/123/author". This is
null
before and after processing operations in an atomic:operations request.
string? PrimaryId { get; }
Property Value
PrimaryResourceType
The primary resource type for this request. This would be "blogs" in "/blogs", "/blogs/123" or "/blogs/123/author". This is null
before and
after processing operations in an atomic:operations request.
ResourceType? PrimaryResourceType { get; }
Property Value
Relationship
The relationship for this request. This would be null
in "/blogs", "/blogs/123" and "/blogs/123/unknownResource" or "author" in
"/blogs/123/author" and "/blogs/123/relationships/author". This is null
before and after processing operations in an atomic:operations
request.
RelationshipAttribute? Relationship { get; }
Property Value
SecondaryResourceType
The secondary resource type for this request. This would be null
in "/blogs", "/blogs/123" and "/blogs/123/unknownResource" or "people" in
"/blogs/123/author" and "/blogs/123/relationships/author". This is null
before and after processing operations in an atomic:operations
request.
ResourceType? SecondaryResourceType { get; }
Property Value
TransactionId
In case of an atomic:operations request, identifies the overarching transaction.
string? TransactionId { get; }
Property Value
WriteOperation
In case of a non-readonly request, this indicates the kind of write operation currently being processed. This is null
when processing a
read-only operation, and before and after processing operations in an atomic:operations request.
WriteOperationKind? WriteOperation { get; }
Property Value
Methods
CopyFrom(IJsonApiRequest)
Performs a shallow copy.
void CopyFrom(IJsonApiRequest other)
Parameters
other
IJsonApiRequest