Open mrtank opened 3 years ago
for the examples the following nuget versions were used>
<PackageReference Include="FSharp.SystemTextJson" Version="0.17.4" />
<PackageReference Include="Microsoft.OpenApi" Version="1.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.2.1" />
Using
Sitelet
'sEndpoint
's type it's possible to generate anOpenAPI
documentation for simple cases. The documentation forOpenAPI
documentation can be found here. With SwaggerUI it's possible to provide a documentation endpoint and offer test calls against the API.is an extension method on
IEndpointRouteBuilder
, which configures the site to route/swagger.json
calls to provide the generatedOpenAPI
documentation for the user.config contains the required Info Object's
Version
andTitle
fields,ServerUrls
andJsonSerializerOptions
for ISerializerDataContractResolver.JsonSerializerOptions
requires https://github.com/Tarmil/FSharp.SystemTextJson.To set up
SwaggerUI
.UseSwaggerUI
needs to point to/swagger.json
.Example code on an
IApplicationBuilder
to setup/swagger
endpoint forSwaggerUI
Documentation generation is restricted to an
Endpoint
type of Discriminated Union, with primitive system type union fields.int
,float
,string
.Example
Endpoint
type:Where no annotation defines the Operation (for example
Get
/Post
), the default isGet
. Parameter name defaults to it'sType
's.Name
.