openapi-flowtype-definition
v1.0.1
Published
OpenAPI 2.0 Flowtype definition
Downloads
5
Readme
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.