Simple Open API F# Parser
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.paket
src/OpenAPIParser
tests/OpenAPIParser.Tests
.gitignore
LICENSE
OpenAPIParser.sln
README.md
RELEASE_NOTES.md
build.fsx
build.proj
fake.cmd
paket.dependencies
paket.lock

README.md

drawing

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 package

Install-Package OpenAPIParser

or using Paket

nuget OpenAPIParser

How to use

Typically, you would use some existing specification (see official examples for version 3):

open OpenAPIParser.Version3.Parser
let openAPI = Document.loadFromYamlFile "mySpec.yaml" 

Then you have basic F# record filled

let version = openAPI.Info.Version
let title = openAPI.Info.Title
let paths = openAPI.Paths
...

Please check test project for more examples.

Limitations

Not all properties from 3.0.1 specification are implemented. Especially anyOf and oneOf Schema objects, which will be probably implemented in future versions. Please check Specification record definition for already implemented properties.

Contribution

You know the drill. Code + Tests = Good PR. Any contribution more than welcome!