Table of Contents

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

IReadOnlySet<JsonApiMediaTypeExtension>

IsCollection

Indicates whether this request targets a single resource or a collection of resources.

bool IsCollection { get; }

Property Value

bool

IsReadOnly

Indicates whether this request targets only fetching of data (resources and relationships), as opposed to applying changes.

bool IsReadOnly { get; }

Property Value

bool

Kind

Routing information, based on the path of the request URL.

EndpointKind Kind { get; }

Property Value

EndpointKind

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

string

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

ResourceType

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

RelationshipAttribute

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

ResourceType

TransactionId

In case of an atomic:operations request, identifies the overarching transaction.

string? TransactionId { get; }

Property Value

string

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

WriteOperationKind?

Methods

CopyFrom(IJsonApiRequest)

Performs a shallow copy.

void CopyFrom(IJsonApiRequest other)

Parameters

other IJsonApiRequest