Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akhansari/fsharp.openapi
F# Wrapper for OpenAPI.NET
https://github.com/akhansari/fsharp.openapi
fsharp openapi
Last synced: 6 days ago
JSON representation
F# Wrapper for OpenAPI.NET
- Host: GitHub
- URL: https://github.com/akhansari/fsharp.openapi
- Owner: akhansari
- License: mit
- Created: 2020-07-15T23:16:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-27T08:43:22.000Z (about 2 years ago)
- Last Synced: 2024-03-11T19:26:35.621Z (8 months ago)
- Topics: fsharp, openapi
- Language: F#
- Homepage:
- Size: 65.4 KB
- Stars: 48
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## FSharp OpenAPI [![NuGet Status](https://img.shields.io/nuget/v/FSharp.OpenApi.svg)](https://www.nuget.org/packages/FSharp.OpenApi)
F# Wrapper for [OpenAPI.NET SDK](https://github.com/microsoft/OpenAPI.NET).
- Describe API specifications with computation expressions.
- Provide helpers for F# libraries to write specifications and exposing them to Swagger UI.This is still a work in progress project and breaking changes could be frequent.\
Contributions are welcome.### Example Usage
Creating an OpenAPI document
```fsharp
let document =
apiDocument {
info (apiInfo {
version "1.0.0"
title "Swagger Petstore (Simple)"
})
servers [
apiServer {
url "http://petstore.swagger.io/api"
}
]
paths [
"/pets", apiPathItem {
operations [
OperationType.Get, apiOperation {
description "Returns all pets from the system that the user has access to"
responses [
HttpStatusCode.OK, apiResponse {
description "OK"
}
]
}
]
}
]
}let outputString =
document.Serialize (OpenApiSpecVersion.OpenApi3_0, OpenApiFormat.Json)
```