Skip to content

Dzoukr/OpenAPIParser

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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!