Fable.Remoting.OpenAPI.Giraffe
0.0.1
See the version list below for details.
dotnet add package Fable.Remoting.OpenAPI.Giraffe --version 0.0.1
NuGet\Install-Package Fable.Remoting.OpenAPI.Giraffe -Version 0.0.1
<PackageReference Include="Fable.Remoting.OpenAPI.Giraffe" Version="0.0.1" />
<PackageVersion Include="Fable.Remoting.OpenAPI.Giraffe" Version="0.0.1" />
<PackageReference Include="Fable.Remoting.OpenAPI.Giraffe" />
paket add Fable.Remoting.OpenAPI.Giraffe --version 0.0.1
#r "nuget: Fable.Remoting.OpenAPI.Giraffe, 0.0.1"
#:package Fable.Remoting.OpenAPI.Giraffe@0.0.1
#addin nuget:?package=Fable.Remoting.OpenAPI.Giraffe&version=0.0.1
#tool nuget:?package=Fable.Remoting.OpenAPI.Giraffe&version=0.0.1
Fable.Remoting.OpenAPI
OpenAPI generation for Fable.Remoting contracts.
Packages
Fable.Remoting.OpenAPI: Core document generation and customization APIs.Fable.Remoting.OpenAPI.Giraffe: Giraffe docs handlers and remoting composition.Fable.Remoting.OpenAPI.Suave: Suave docs webpart helpers and composition.
Highlights
- OpenAPI 3.0.3 JSON and YAML generation from shared API contracts.
- Typed endpoint metadata helpers via quotations.
- Remoting-aware route generation (uses active route builder).
- Defaults docs routes from route builder and API type name.
- Deterministic output suitable for snapshot-style tests.
This project was instantiated by AI agents and was not fully reviewed by humans at the time of this commit. It was done to quickly deviler a working prototype of the intended functionality.
Core Usage
open Fable.Remoting.OpenAPI
let document =
OpenApi.options
|> OpenApi.withTitle "My API"
|> OpenApi.withVersion "1.0.0"
|> OpenApi.generate<MySharedApi>
Giraffe Integration
open Fable.Remoting.Server
open Fable.Remoting.Giraffe
open Fable.Remoting.OpenAPI
let docsOptions =
OpenApi.options
|> OpenApi.withTitle "My API"
|> OpenApi.withVersion "1.0.0"
let webApp =
Remoting.createApi ()
|> Remoting.withRouteBuilder (fun typeName methodName -> sprintf "/api/%s/%s" typeName methodName)
|> Remoting.fromValue apiImplementation
|> Remoting.OpenAPI.withDocs docsOptions
By default, the docs routes follow the same remoting route base:
/api/<TypeName>/docs/api/<TypeName>/docs/openapi.json/api/<TypeName>/docs/openapi.yaml
You can still override with OpenApi.withRoutes.
Suave Integration
open Fable.Remoting.OpenAPI
open Fable.Remoting.OpenAPI.Suave
let document =
OpenApi.options
|> OpenApi.withTitle "My API"
|> OpenAPI.withDocs remotingOptions
let app =
OpenApiSuave.withDocsWebPart document remotingWebPart
Type-safe Endpoint Metadata
open Fable.Remoting.OpenAPI
let docs =
OpenApi.options
|> OpenAPI.withEndpointDocsFor<MyApi, CreateOrder -> Async<OrderId>>
<@ fun api -> api.createOrder @>
{ OpenApiDefaults.endpointDocumentation with Summary = Some "Create order" }
|> OpenAPI.withEndpointRequestExampleFor<MyApi, CreateOrder, OrderId>
<@ fun api -> api.createOrder @>
{ customerId = "c-1"; amount = 12.5m }
Development
Solution files used by CI and local workflows:
Fable.Remoting.OpenApi.slnfor restore/build/test.Release.slnfor restore/pack of publishable packages only.
Typical local commands:
dotnet restore ./Fable.Remoting.OpenApi.sln
dotnet test ./Fable.Remoting.OpenApi.sln
dotnet restore ./Release.sln
dotnet pack ./Release.sln -c Release --no-restore -o artifacts
See CONTRIBUTING.md for full setup and contribution guidance.
| 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 was computed. 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. |
-
net8.0
- Fable.Remoting.Giraffe (>= 5.23.0)
- Fable.Remoting.OpenAPI (>= 0.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
### Added
- Dedicated Giraffe adapter package for docs and remoting composition.
- `Remoting.OpenAPI.withDocs` integration for a remoting-first pipeline.
### Fixed
- Normalizes empty Content-Type for GET remoting calls before remoting handler execution.