Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dzoukr/openapiparser
Simple Open API F# Parser
https://github.com/dzoukr/openapiparser
fsharp openapi openapi3
Last synced: about 1 month ago
JSON representation
Simple Open API F# Parser
- Host: GitHub
- URL: https://github.com/dzoukr/openapiparser
- Owner: Dzoukr
- License: mit
- Created: 2018-06-09T10:43:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T12:57:53.000Z (about 6 years ago)
- Last Synced: 2024-08-08T16:33:41.461Z (3 months ago)
- Topics: fsharp, openapi, openapi3
- Language: F#
- Homepage:
- Size: 98.6 KB
- Stars: 11
- Watchers: 6
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open API F# Parser
Simple library for parsing YAML/JSON Open API (previously called as Swagger) specification (version 3.0.1). Originally part of my type provider, but I will probably never finish it, so at least community can use part of it for own projects. :)
## Installation
First install NuGet packageInstall-Package OpenAPIParser
or using [Paket](http://fsprojects.github.io/Paket/getting-started.html)
nuget OpenAPIParser
## How to use
Typically, you would use some existing specification (see [official examples for version 3](https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v3.0)):
```fsharp
open OpenAPIParser.Version3.Parser
let openAPI = Document.loadFromYamlFile "mySpec.yaml"
```Then you have basic F# record filled
```fsharp
let version = openAPI.Info.Version
let title = openAPI.Info.Title
let paths = openAPI.Paths
...
```Please check [test project](https://github.com/Dzoukr/OpenAPIParser/tree/master/tests/OpenAPIParser.Tests) for more examples.
## Limitations
Not all properties from [3.0.1 specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md) are implemented. Especially `anyOf` and `oneOf` Schema objects, which will be probably implemented in future versions. Please check [Specification record definition](https://github.com/Dzoukr/OpenAPIParser/blob/master/src/OpenAPIParser/Version3/Specification.fs) for already implemented properties.
## Contribution
You know the drill. Code + Tests = Good PR. Any contribution more than welcome!