1.0.1 • Published 9 years ago
openapi-flowtype-definition
Licence
MIT
Version
1.0.1
Deps
0
Vulns
0
Weekly
0
OpenAPI 2.0 Flowtype definition
This repo contains Flowtype annotations for the OpenAPI 2.0 (or Swagger 2.0) JSON format. It uses exact object types for each specified OpenAPI object and doesn't allow vendor extensions.
Install
npm i --save-dev openapi-flowtype-definition
or
yarn add --dev openapi-flowtype-definition
How to use
Assuming that your project is set up with Flowtype, import the type whenever you need to type check a JS object containing the OpenAPI definition:
import type { OpenAPI } from 'openapi-flowtype-definition';
const api: OpenAPI = {
swagger: "2.0",
// etc...
}
See the example under ./example for more examples.