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
Extensions
The JSON:API extensions enabled for the current request. This is always a subset of Extensions.
public IReadOnlySet<JsonApiMediaTypeExtension> Extensions { get; set; }
Property Value
IsCollection
Indicates whether this request targets a single resource or a collection of resources.
public bool IsCollection { get; set; }
Property Value
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
Kind
Routing information, based on the path of the request URL.
public EndpointKind Kind { get; set; }
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.
public string? PrimaryId { get; set; }
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.
public ResourceType? PrimaryResourceType { get; set; }
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.
public RelationshipAttribute? Relationship { get; set; }
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.
public ResourceType? SecondaryResourceType { get; set; }
Property Value
TransactionId
In case of an atomic:operations request, identifies the overarching transaction.
public string? TransactionId { get; set; }
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.
public WriteOperationKind? WriteOperation { get; set; }
Property Value
Methods
CopyFrom(IJsonApiRequest)
Performs a shallow copy.
public void CopyFrom(IJsonApiRequest other)
Parameters
other
IJsonApiRequest