REST API / querying
RsqlParserNet
RSQL/FIQL query-expression parser for .NET REST APIs
net10.0
Features
- Typed AST with diagnostics
- Allowlisted predicates for IQueryable<T> (LINQ)
- filter/sort/page binding in ASP.NET Core
- Async EF Core paging helpers
- Query-parameter docs for OpenAPI / Swashbuckle / NSwag
Installation
dotnet add package RsqlParserNetQuick start
using RsqlParserNet;
// GET /products?filter=status==active;price=gt=100&sort=-createdAt
if (RsqlParser.TryParse("status==active;price=gt=100", out var query, out var errors))
{
// walk the typed AST, or apply an allowlisted LINQ profile
var predicate = profile.ApplyRsql(query);
var page = await dbContext.Products
.Where(predicate)
.ToRsqlPageAsync(page: 1, pageSize: 25);
}
else
{
return Results.ValidationProblem(errors.ToValidationErrors());
}Key methods
RsqlParser.TryParseParse a filter into the ASTApplyRsqlAllowlisted LINQ predicateToRsqlPageAsyncCount and materialize a pagePackage family
READMEgithub.com/ai-iskuzhin/RsqlParserNet
Loading README from the repository…