Table of Contents

Class SparseFieldSetParser

Namespace
JsonApiDotNetCore.Queries.Parsing
Assembly
JsonApiDotNetCore.dll

Parses the JSON:API 'fields' query string parameter value.

[PublicAPI]
public class SparseFieldSetParser : QueryExpressionParser, ISparseFieldSetParser
Inheritance
SparseFieldSetParser
Implements
Inherited Members

Methods

Parse(string, ResourceType)

Parses the specified source into a SparseFieldSetExpression. Throws a QueryParseException if the input is invalid.

public SparseFieldSetExpression? Parse(string source, ResourceType resourceType)

Parameters

source string

The source text to read from.

resourceType ResourceType

The resource type used to lookup JSON:API fields that are referenced in source.

Returns

SparseFieldSetExpression

ParseSparseFieldSet(ResourceType)

protected virtual SparseFieldSetExpression? ParseSparseFieldSet(ResourceType resourceType)

Parameters

resourceType ResourceType

Returns

SparseFieldSetExpression

ValidateField(ResourceFieldAttribute, int)

Enables derived types to throw a QueryParseException when usage of a JSON:API field inside a field chain is not permitted.

protected override void ValidateField(ResourceFieldAttribute field, int position)

Parameters

field ResourceFieldAttribute
position int