RsqlParserNet.NSwag
1.1.0
dotnet add package RsqlParserNet.NSwag --version 1.1.0
NuGet\Install-Package RsqlParserNet.NSwag -Version 1.1.0
<PackageReference Include="RsqlParserNet.NSwag" Version="1.1.0" />
<PackageVersion Include="RsqlParserNet.NSwag" Version="1.1.0" />
<PackageReference Include="RsqlParserNet.NSwag" />
paket add RsqlParserNet.NSwag --version 1.1.0
#r "nuget: RsqlParserNet.NSwag, 1.1.0"
#:package RsqlParserNet.NSwag@1.1.0
#addin nuget:?package=RsqlParserNet.NSwag&version=1.1.0
#tool nuget:?package=RsqlParserNet.NSwag&version=1.1.0
RsqlParserNet.NSwag
NSwag operation processors that document the filter, sort, page, and pageSize query parameters in Swagger/OpenAPI documents generated through NSwag, including APIs that use FastEndpoints.Swagger.
Part of the RsqlParserNet family. It builds on RsqlParserNet.AspNetCore (and the core RsqlParserNet parser) and references NSwag.Generation.AspNetCore. For other OpenAPI stacks, use RsqlParserNet.OpenApi for ASP.NET Core's built-in OpenAPI document generation, or RsqlParserNet.Swashbuckle for Swashbuckle.
Installation
dotnet add package RsqlParserNet.NSwag
Quick start
Register the endpoint-scoped operation processor once on the NSwag document generator settings:
using RsqlParserNet.NSwag;
builder.Services.AddOpenApiDocument(options =>
{
options.AddRsqlQueryParametersOperationProcessor();
});
Then mark only the endpoints that accept RSQL query parameters:
app.MapGet("/products", HandleProducts)
.WithRsqlNSwagQueryParameters();
By default this documents the optional filter, sort, page, and pageSize query parameters.
Customize parameter names (keep them aligned with AddRsqlQueryRequest(...)) and document partial query contracts:
app.MapGet("/products/search", HandleSearch)
.WithRsqlNSwagQueryParameters(options =>
{
options.FilterParameterName = "q";
options.IncludeSort = false;
options.IncludePagination = false;
});
For small APIs where every list endpoint shares the same query contract, document every operation with a single global processor instead:
builder.Services.AddOpenApiDocument(options =>
{
options.AddRsqlQueryParametersToAllOperations();
});
Endpoint-scoped documentation is the safer default for larger APIs because it avoids advertising query parameters on endpoints that do not accept them.
API
| Member | Kind | Description |
|---|---|---|
RsqlNSwagDocumentGeneratorSettingsExtensions.AddRsqlQueryParametersOperationProcessor(this TSettings) |
Settings extension | Registers an endpoint-scoped operation processor. Only endpoints marked with WithRsqlNSwagQueryParameters(...) are documented. |
RsqlNSwagDocumentGeneratorSettingsExtensions.AddRsqlQueryParametersToAllOperations(this TSettings, Action<RsqlOpenApiQueryOptions>?) |
Settings extension | Registers a processor that documents RSQL query parameters on every operation. |
RsqlNSwagEndpointConventionBuilderExtensions.WithRsqlNSwagQueryParameters(this TBuilder, Action<RsqlOpenApiQueryOptions>?) |
Endpoint extension | Marks an endpoint as accepting RSQL query parameters and configures which parameters and names to document. |
RsqlNSwagOperationDocumenter.Apply(OpenApiOperation, RsqlOpenApiQueryOptions?) |
Static helper | Adds configured RSQL query parameters to an NSwag operation. Use it to compose RSQL documentation inside your own operation processor. |
RsqlNSwagQueryParametersOperationProcessor |
Operation processor | The IOperationProcessor registered by AddRsqlQueryParametersOperationProcessor. Documents endpoints carrying RSQL metadata. |
RsqlNSwagAllQueryParametersOperationProcessor |
Operation processor | The IOperationProcessor registered by AddRsqlQueryParametersToAllOperations. Documents every operation. |
RsqlNSwagQueryMetadata |
Endpoint metadata | Carries the RsqlOpenApiQueryOptions attached by WithRsqlNSwagQueryParameters. |
Parameter names, descriptions, and inclusion flags (FilterParameterName, SortParameterName, PageParameterName, PageSizeParameterName, IncludeFilter, IncludeSort, IncludePagination, and related descriptions) come from RsqlOpenApiQueryOptions in RsqlParserNet.OpenApi.
Documentation
- NSwag usage: docs/nswag-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
- Microsoft.OpenApi (>= 2.7.5)
- NSwag.Generation.AspNetCore (>= 14.7.1)
- RsqlParserNet.OpenApi (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Minor release updating the transitive Microsoft.OpenApi dependency to 2.7.5 to address CVE-2026-49451 (GHSA-v5pm-xwqc-g5wc).