![]() |
VOOZH | about |
dotnet add package Rystem.Api.Server --version 10.0.8
NuGet\Install-Package Rystem.Api.Server -Version 10.0.8
<PackageReference Include="Rystem.Api.Server" Version="10.0.8" />
<PackageVersion Include="Rystem.Api.Server" Version="10.0.8" />Directory.Packages.props
<PackageReference Include="Rystem.Api.Server" />Project file
paket add Rystem.Api.Server --version 10.0.8
#r "nuget: Rystem.Api.Server, 10.0.8"
#:package Rystem.Api.Server@10.0.8
#addin nuget:?package=Rystem.Api.Server&version=10.0.8Install as a Cake Addin
#tool nuget:?package=Rystem.Api.Server&version=10.0.8Install as a Cake Tool
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.
dotnet add package Rystem.Api.Server
The server package provides two main entry points:
AddServerIntegrationForRystemApi(...)UseEndpointApi()It also adds:
UseEndpointApiModels()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:
EndpointOptions as a singletonHasSwagger = trueEndpointOptions 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:
EndpointOptionsAddEndpointWithFactory<T>() registrations into one endpoint set per factory nameMapGet or MapPostWithout UseEndpointApi(), the metadata registered in Rystem.Api never becomes HTTP routes.
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/SearchPath-bound parameters are appended after the method segment.
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 |
UseEndpointApi() honors the shared binding metadata from Rystem.Api:
Request.QueryRequest.CookiesRequest.HeadersIt also handles:
CancellationToken injectionIFormFile inputIHttpFile inputStream input and outputIAsyncEnumerable<T> outputAuthorization is driven by the metadata attached in ApiEndpointBuilder<T>.
At mapping time the server applies these rules:
Policies == null → AllowAnonymous()Policies.Length == 0 → RequireAuthorization()RequireAuthorization(policies)That means:
AddAuthorizationForAll() means authenticated users onlyAddAuthorizationForAll("policy") means authenticated users that satisfy that policyAddEndpointWithFactory<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/SearchUseEndpointApiModels()UseEndpointApiModels() adds a model-export endpoint for the currently hardcoded language list.
Right now that means:
GET /Business/Models/TypescriptIt 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.
If the shared Rystem.Api registration includes interface properties, the server will map them unless you removed those methods earlier.
If you rely on AddEndpointWithFactory<T>(), remember that the real fan-out happens only when the server maps endpoints.
UseEndpointApi() always maps the raw OpenAPI document. Swagger UI and Scalar are the optional parts.
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.csUse 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 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 5,532 | 5/13/2026 |
| 10.0.7 | 207 | 3/26/2026 |
| 10.0.6 | 433,647 | 3/3/2026 |
| 10.0.5 | 165 | 2/22/2026 |
| 10.0.4 | 170 | 2/9/2026 |
| 10.0.3 | 147,965 | 1/28/2026 |
| 10.0.1 | 209,132 | 11/12/2025 |
| 9.1.3 | 310 | 9/2/2025 |
| 9.1.2 | 764,540 | 5/29/2025 |
| 9.1.1 | 97,840 | 5/2/2025 |
| 9.0.32 | 186,729 | 4/15/2025 |
| 9.0.31 | 5,879 | 4/2/2025 |
| 9.0.30 | 88,898 | 3/26/2025 |
| 9.0.29 | 9,065 | 3/18/2025 |
| 9.0.28 | 268 | 3/17/2025 |
| 9.0.27 | 301 | 3/16/2025 |
| 9.0.26 | 283 | 3/13/2025 |
| 9.0.25 | 52,155 | 3/9/2025 |
| 9.0.21 | 364 | 3/6/2025 |
| 9.0.20 | 19,620 | 3/6/2025 |