Table of Contents

Class JsonApiRequest

Namespace
JsonApiDotNetCore.Middleware
Assembly
JsonApiDotNetCore.dll

Metadata associated with the JSON:API request that is currently being processed.

[PublicAPI]
public sealed class JsonApiRequest : IJsonApiRequest
Inheritance
JsonApiRequest
Implements
Inherited Members

Properties

IsCollection

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

public bool IsCollection { get; set; }

Property Value

bool

IsReadOnly

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

public bool IsReadOnly { get; set; }

Property Value

bool

Kind

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

public EndpointKind Kind { get; set; }

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.

public string? PrimaryId { get; set; }

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.

public ResourceType? PrimaryResourceType { get; set; }

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.

public RelationshipAttribute? Relationship { get; set; }

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.

public ResourceType? SecondaryResourceType { get; set; }

Property Value

ResourceType

TransactionId

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

public string? TransactionId { get; set; }

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.

public WriteOperationKind? WriteOperation { get; set; }

Property Value

WriteOperationKind?

Methods

CopyFrom(IJsonApiRequest)

Performs a shallow copy.

public void CopyFrom(IJsonApiRequest other)

Parameters

other IJsonApiRequest