RsqlParserNet.FastEndpoints
1.0.3
dotnet add package RsqlParserNet.FastEndpoints --version 1.0.3
NuGet\Install-Package RsqlParserNet.FastEndpoints -Version 1.0.3
<PackageReference Include="RsqlParserNet.FastEndpoints" Version="1.0.3" />
<PackageVersion Include="RsqlParserNet.FastEndpoints" Version="1.0.3" />
<PackageReference Include="RsqlParserNet.FastEndpoints" />
paket add RsqlParserNet.FastEndpoints --version 1.0.3
#r "nuget: RsqlParserNet.FastEndpoints, 1.0.3"
#:package RsqlParserNet.FastEndpoints@1.0.3
#addin nuget:?package=RsqlParserNet.FastEndpoints&version=1.0.3
#tool nuget:?package=RsqlParserNet.FastEndpoints&version=1.0.3
RsqlParserNet.FastEndpoints
FastEndpoints binding and validation glue for RSQL/FIQL-style REST API query expressions. It reuses the ASP.NET Core query models and translates invalid RSQL input into FastEndpoints ValidationFailure entries, so APIs keep their normal validation response flow.
Part of the RsqlParserNet family. This package builds on RsqlParserNet.AspNetCore, reusing its bindable RsqlQueryRequest model and option registration. Filtering and sorting still use explicit, allowlisted RsqlLinqProfile<T> mappings.
Requirements
RsqlParserNet.FastEndpoints currently requires FastEndpoints 7.0.1 or newer. Applications on FastEndpoints 5.x or 6.x should either upgrade FastEndpoints before installing this adapter or use the framework-neutral ASP.NET Core query models directly through RsqlQueryRequest.Parse(...).
FastEndpoints 7 applications that call UseAuthorization() must also register authorization services, for example with builder.Services.AddAuthorization().
Installation
dotnet add package RsqlParserNet.FastEndpoints
Quick start
Register the shared query options (same registration as the ASP.NET Core adapter):
using RsqlParserNet;
using RsqlParserNet.AspNetCore;
builder.Services.AddRsqlQueryRequest(
configureFilter: options =>
{
options.QueryParameterName = "filter";
options.ParseOptions = ProductRsqlProfile.Instance.ConfigureParseOptions(RsqlParseOptions.Default);
},
configureSort: options => options.SortParameterName = "sort",
configurePage: options =>
{
options.DefaultPageSize = 50;
options.MaxPageSize = 100;
});
Bind and validate inside the endpoint. BindRsqlQueryRequestAndAddErrors() reads filter, sort, page, and pageSize from the current HttpContext, applies the configured option names, and adds failures when parsing or binding fails. ThrowIfAnyErrors() then returns FastEndpoints' normal validation response:
using FastEndpoints;
using RsqlParserNet.EntityFrameworkCore;
using RsqlParserNet.FastEndpoints;
using RsqlParserNet.Linq;
public sealed class ListProductsEndpoint : EndpointWithoutRequest<RsqlPagedResult<ProductResponse>>
{
private readonly AppDbContext _db;
public ListProductsEndpoint(AppDbContext db)
{
_db = db;
}
public override void Configure()
{
Get("/products");
}
public override async Task HandleAsync(CancellationToken cancellationToken)
{
var rsql = this.BindRsqlQueryRequestAndAddErrors();
ThrowIfAnyErrors();
if (!rsql.TryApplyTo(_db.Products, ProductRsqlProfile.Instance, out var query, out var errors))
{
this.AddRsqlValidationFailures(errors);
ThrowIfAnyErrors();
}
query = rsql.Sort.HasRequest
? query
: query.OrderBy(product => product.Id);
var result = await query
.Select(product => new ProductResponse(product.Id, product.Name))
.ToRsqlPageAsync(rsql.PageRequest, cancellationToken);
await Send.OkAsync(result, cancellationToken);
}
}
Filter diagnostics become ValidationFailure entries on the filter query parameter, with the parser diagnostic code preserved as the FastEndpoints error code. Sort and page failures are keyed by their query parameter names. Call TryApplyTo() before materializing the query so unknown selectors, unsupported operators, or value conversion failures become validation failures instead of unhandled exceptions.
For a custom response shape, inspect the bound request directly:
var rsql = this.BindRsqlQueryRequest();
if (!rsql.IsValid)
{
var errors = rsql.GetErrors();
// Map errors to the API's response contract.
}
API
All members are extension methods on RsqlFastEndpointExtensions.
| Method | Description |
|---|---|
IEndpoint.BindRsqlQueryRequest() |
Binds filter, sort, page, and pageSize from the endpoint's HttpContext using the configured option names and returns the RsqlQueryRequest. Does not add failures. |
IEndpoint.BindRsqlQueryRequestAndAddErrors() |
Binds the request and adds any RSQL binding/parse failures to the endpoint. Returns the RsqlQueryRequest. Call ThrowIfAnyErrors() afterward. |
IEndpoint.AddRsqlValidationFailures(RsqlQueryRequest request) |
Adds the request's RSQL errors to the endpoint's ValidationFailures. |
IEndpoint.AddRsqlValidationFailures(IReadOnlyList<RsqlQueryError> errors) |
Adds structured RSQL errors (for example from TryApplyTo) to the endpoint's ValidationFailures. |
RsqlQueryRequest.ToFastEndpointValidationFailures() |
Converts the request's RSQL binding errors into a list of ValidationFailure. |
IReadOnlyList<RsqlQueryError>.ToFastEndpointValidationFailures() |
Converts structured RSQL binding or translation errors into a list of ValidationFailure. |
Documentation
- FastEndpoints usage: docs/fastendpoints-usage.md
- Main repository: RsqlParserNet
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FastEndpoints (>= 7.0.1)
- RsqlParserNet.AspNetCore (>= 1.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.3 | 108 | 6/16/2026 |
| 1.0.2 | 99 | 5/23/2026 |
| 1.0.1 | 98 | 5/18/2026 |
| 1.0.0 | 152 | 5/10/2026 |
| 0.3.0-preview.1 | 63 | 5/6/2026 |
| 0.2.0-preview.1 | 134 | 5/5/2026 |
Maintenance release aligning the RsqlParserNet package family at 1.0.3 and adding a dedicated package README.