项目作者: Dzoukr

项目描述 :
Simple Open API F# Parser
高级语言: F#
项目地址: git://github.com/Dzoukr/OpenAPIParser.git
创建时间: 2018-06-09T10:43:53Z
项目社区:https://github.com/Dzoukr/OpenAPIParser

开源协议:MIT License

下载


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

  1. Install-Package OpenAPIParser

or using Paket

  1. nuget OpenAPIParser

How to use

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

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

Then you have basic F# record filled

  1. let version = openAPI.Info.Version
  2. let title = openAPI.Info.Title
  3. let paths = openAPI.Paths
  4. ...

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!