Etymon.Api.AspNetCore
0.1.0-preview.13
dotnet add package Etymon.Api.AspNetCore --version 0.1.0-preview.13
NuGet\Install-Package Etymon.Api.AspNetCore -Version 0.1.0-preview.13
<PackageReference Include="Etymon.Api.AspNetCore" Version="0.1.0-preview.13" />
<PackageVersion Include="Etymon.Api.AspNetCore" Version="0.1.0-preview.13" />
<PackageReference Include="Etymon.Api.AspNetCore" />
paket add Etymon.Api.AspNetCore --version 0.1.0-preview.13
#r "nuget: Etymon.Api.AspNetCore, 0.1.0-preview.13"
#:package Etymon.Api.AspNetCore@0.1.0-preview.13
#addin nuget:?package=Etymon.Api.AspNetCore&version=0.1.0-preview.13&prerelease
#tool nuget:?package=Etymon.Api.AspNetCore&version=0.1.0-preview.13&prerelease
Etymon.Api.AspNetCore
Registers an Etymon endpoint on ASP.NET Core minimal-API routing.
Part of the Etymon suite. Depends on
Etymon.Api and ASP.NET Core — no third-party web framework. ASP.NET Core is
the platform rather than a library, so this is the adapter for an application
that does not want one.
let app = builder.Build()
app |> MinimalApi.map getUser (fun userId _ctx -> task {
match! findUser userId with
| Some user -> return Handled.Ok user
| None -> return Handled.Failed(404, None)
})
app |> MinimalApi.mapWithBody createUser (fun () newUser _ctx -> task {
let! created = insert newUser
return Handled.Ok created
})
The route template comes from the endpoint's own Route value, so ASP.NET's
router does the matching and Etymon does the binding. That is the opposite of
the Giraffe adapter, which matches itself because Giraffe has no template-based
routing to hand the work to — and it means Etymon endpoints appear in ASP.NET's
endpoint metadata like any others.
What you get for free
The request body is decoded and validated before your handler runs. A body the schema rejects comes back as 422 with every problem and its path; your handler is never called with a value the schema would not accept, and contains no validation code of its own.
A path value that does not parse is a 400, not a handler call.
/users/hello against /users/{id} where id is a Guid never reaches you.
An undeclared status is refused. Returning Handled.Failed(418, …) from an
endpoint that never declared 418 raises, naming the statuses it did. A status
the OpenAPI document omits and the generated client cannot handle is a bug in
the handler, not something to forward.
It appears in your OpenAPI document
An endpoint registers itself with the metadata ASP.NET already understands: operation id, summary, tags, the request type, and every status it declares, not just the successful one. An application that already publishes a document gets Etymon endpoints in it without describing them a second time — and a hand-written second description is the one that goes stale.
The 422 the adapter produces for a body the schema refuses is declared too, even though the endpoint never mentions it. It is part of the contract whether or not anyone wrote it down, and a caller meeting it for the first time in production is the alternative.
What does not reach that document is the constraints. ASP.NET builds its schemas
by reflecting over the CLR type, and the type does not know that role is one of
three strings. ApiOpenApi writes a document that does carry them; joining the
two needs a document transformer, and that needs an OpenAPI package this one
deliberately does not take.
Tested against the real thing
The adapter is exercised end to end through Microsoft.AspNetCore.TestHost:
real requests, real routing, real status codes, driven by Etymon.Api.Client.
The same tests run against the Giraffe adapter, and one asserts the two produce
byte-identical responses — which is the point of one declaration with several
interpreters.
Public surface
The complete public surface of this package, every value with its full signature
and its documentation, is in Surface.fsi beside this file. It is written by the
build from the implementation, so it is where to learn what a function hands
back without compiling anything.
Licence
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Etymon.Api (>= 0.1.0-preview.13)
- Etymon.Core (>= 0.1.0-preview.13)
- Etymon.Schema (>= 0.1.0-preview.13)
- FSharp.Core (>= 8.0.100)
-
net8.0
- Etymon.Api (>= 0.1.0-preview.13)
- Etymon.Core (>= 0.1.0-preview.13)
- Etymon.Schema (>= 0.1.0-preview.13)
- FSharp.Core (>= 8.0.100)
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 |
|---|---|---|
| 0.1.0-preview.13 | 0 | 9/22/2026 |
| 0.1.0-preview.12 | 0 | 9/22/2026 |
| 0.1.0-preview.11 | 0 | 9/22/2026 |
| 0.1.0-preview.10 | 0 | 9/22/2026 |
| 0.1.0-preview.9 | 0 | 9/22/2026 |
| 0.1.0-preview.8 | 0 | 9/22/2026 |
| 0.1.0-preview.7 | 6 | 9/21/2026 |
| 0.1.0-preview.6 | 23 | 9/21/2026 |
| 0.1.0-preview.5 | 27 | 9/21/2026 |
| 0.1.0-preview.4 | 34 | 9/21/2026 |
| 0.1.0-preview.3 | 36 | 9/21/2026 |
| 0.1.0-preview.2 | 34 | 9/20/2026 |
| 0.1.0-preview.1 | 33 | 9/20/2026 |