Rystem.Api.Server
10.0.7
dotnet add package Rystem.Api.Server --version 10.0.7
NuGet\Install-Package Rystem.Api.Server -Version 10.0.7
<PackageReference Include="Rystem.Api.Server" Version="10.0.7" />
<PackageVersion Include="Rystem.Api.Server" Version="10.0.7" />
<PackageReference Include="Rystem.Api.Server" />
paket add Rystem.Api.Server --version 10.0.7
#r "nuget: Rystem.Api.Server, 10.0.7"
#:package Rystem.Api.Server@10.0.7
#addin nuget:?package=Rystem.Api.Server&version=10.0.7
#tool nuget:?package=Rystem.Api.Server&version=10.0.7
Rystem.Api.Server
Rystem.Api.Server is the ASP.NET Core runtime layer for Rystem.Api.
It takes the endpoint metadata recorded by AddEndpoint<T>(...) / AddEndpointWithFactory<T>(...) and turns it into minimal API routes.
Installation
dotnet add package Rystem.Api.Server
What this package adds
The server package provides two main entry points:
AddServerIntegrationForRystemApi(...)UseEndpointApi()
It also adds:
- OpenAPI document setup
- optional Swagger UI
- optional Scalar UI
- optional model-export endpoint via
UseEndpointApiModels()
Typical setup
This follows the structure used in src/Api/Test/Rystem.Api.TestServer/Program.cs.
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTransient<IColam, Comad>();
builder.Services.AddFactory<ISalubry, Salubry>();
builder.Services.AddFactory<ISalubry, Salubry2>("Doma");
builder.Services.AddBusiness();
builder.Services.AddAuthorization(options =>
{
options.AddPolicy("policy", policy =>
{
policy.RequireClaim("name");
});
});
builder.Services.AddServerIntegrationForRystemApi(options =>
{
options.HasScalar = true;
options.HasSwagger = true;
});
var app = builder.Build();
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpointApi();
app.UseEndpointApiModels();
app.Run();
AddServerIntegrationForRystemApi(...)
AddServerIntegrationForRystemApi(...) currently does three things:
- registers
EndpointOptionsas a singleton - adds OpenAPI with a custom document transformer
- adds Swagger generation only when
HasSwagger = true
EndpointOptions exposes:
| Property | Default | Meaning |
|---|---|---|
HasSwagger |
false |
enable Swagger UI |
HasScalar |
false |
enable Scalar API reference |
UseEndpointApi()
UseEndpointApi() is the real mapping step.
At runtime it:
- reads
EndpointOptions - maps raw OpenAPI JSON
- optionally maps Scalar and Swagger UI
- expands
AddEndpointWithFactory<T>()registrations into one endpoint set per factory name - maps every endpoint method as
MapGetorMapPost
Without UseEndpointApi(), the metadata registered in Rystem.Api never becomes HTTP routes.
Route pattern
The effective route pattern is:
{BasePath}{EndpointName}/{FactoryName?}{MethodName}/{PathParams...}
Examples from the sample domain registrations:
rapi/Salubriend/Getrapi/E/Doma/Getrapi/EmbeddingService/First/Searchrapi/EmbeddingService/Second/Search
Path-bound parameters are appended after the method segment.
HTTP verb selection
The server uses only GET and POST.
| Condition | Verb |
|---|---|
| no body-bound parameters | GET |
| at least one body-bound parameter | POST |
Multipart handling is inferred separately:
| Condition | Request shape |
|---|---|
| more than one body parameter | multipart/form-data |
any Stream, IFormFile, or IHttpFile parameter |
multipart/form-data |
| single non-stream body parameter | plain request body |
Binding behavior
UseEndpointApi() honors the shared binding metadata from Rystem.Api:
- query parameters come from
Request.Query - cookie parameters come from
Request.Cookies - header parameters come from
Request.Headers - path parameters come from route segments
- body parameters come either from the raw request body or from multipart form fields/files
It also handles:
CancellationTokeninjectionIFormFileinputIHttpFileinputStreaminput and outputIAsyncEnumerable<T>output
Authorization behavior
Authorization is driven by the metadata attached in ApiEndpointBuilder<T>.
At mapping time the server applies these rules:
Policies == null→AllowAnonymous()Policies.Length == 0→RequireAuthorization()- named policies →
RequireAuthorization(policies)
That means:
- no authorization metadata leaves the route anonymous
AddAuthorizationForAll()means authenticated users onlyAddAuthorizationForAll("policy")means authenticated users that satisfy that policy
Factory-backed endpoints
AddEndpointWithFactory<T>() is expanded on the server by resolving IFactoryNames<T>.
For each factory name, UseEndpointApi() creates a concrete endpoint set with the factory segment baked into the route.
So this pattern:
builder.Services.AddFactory<IEmbeddingService, EmbeddingService1>(EmbeddingType.First);
builder.Services.AddFactory<IEmbeddingService, EmbeddingService2>(EmbeddingType.Second);
builder.Services.AddEndpointWithFactory<IEmbeddingService>();
becomes routes such as:
rapi/EmbeddingService/First/Searchrapi/EmbeddingService/Second/Search
UseEndpointApiModels()
UseEndpointApiModels() adds a model-export endpoint for the currently hardcoded language list.
Right now that means:
GET /Business/Models/Typescript
It inspects endpoint method return types and parameter types, filters out primitives and infrastructure types, and returns generated model text.
This endpoint does not use BasePath.
Important caveats
Property getters can become routes
If the shared Rystem.Api registration includes interface properties, the server will map them unless you removed those methods earlier.
Factory expansion happens here, not in the core package
If you rely on AddEndpointWithFactory<T>(), remember that the real fan-out happens only when the server maps endpoints.
OpenAPI raw JSON is always mapped
UseEndpointApi() always maps the raw OpenAPI document. Swagger UI and Scalar are the optional parts.
Grounded by sample files
src/Api/Test/Rystem.Api.TestServer/Program.cssrc/Api/Test/Rystem.Api.Test.Domain/ServiceCollectionExtensions.cssrc/Api/Test/Rystem.Api.Test.Domain/IColam.cssrc/Api/Test/Rystem.Api.Test.Domain/IEmbeddingService.cs
Use this package when you want the interface metadata from Rystem.Api to become real ASP.NET Core endpoints.
| 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
- Rystem.Api (>= 10.0.7)
- Scalar.AspNetCore (>= 2.13.15)
- Swashbuckle.AspNetCore (>= 10.1.7)
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 |
|---|---|---|
| 10.0.7 | 90 | 3/26/2026 |
| 10.0.6 | 193,753 | 3/3/2026 |
| 10.0.5 | 132 | 2/22/2026 |
| 10.0.4 | 141 | 2/9/2026 |
| 10.0.3 | 147,934 | 1/28/2026 |
| 10.0.1 | 209,106 | 11/12/2025 |
| 9.1.3 | 278 | 9/2/2025 |
| 9.1.2 | 764,514 | 5/29/2025 |
| 9.1.1 | 97,814 | 5/2/2025 |
| 9.0.32 | 186,699 | 4/15/2025 |
| 9.0.31 | 5,856 | 4/2/2025 |
| 9.0.30 | 88,876 | 3/26/2025 |
| 9.0.29 | 9,036 | 3/18/2025 |
| 9.0.28 | 239 | 3/17/2025 |
| 9.0.27 | 273 | 3/16/2025 |
| 9.0.26 | 253 | 3/13/2025 |
| 9.0.25 | 52,127 | 3/9/2025 |
| 9.0.21 | 337 | 3/6/2025 |
| 9.0.20 | 19,593 | 3/6/2025 |
| 9.0.19 | 328 | 3/6/2025 |