0.3.0 • Published 6 years ago
openapi3-flowtype-definition v0.3.0
OpenAPI3-FlowType-definition
This repo contains Flowtype annotations for the OpenAPI 3.0 JSON format. Annotation is generatoed by json-schema-to-flow-type from OAI/OpenAPI-Specification #1236
note: OAI/OpenAPI-Specification #1270 - Alternative OAS3 JSON Schema
install
npm install --save-dev openapi3-flowtype-definition
or
yarn add --dev openapi3-flowtype-definition
Example
yarn init
yarn add -D babel-cli babel-preset-flow flow-bin
echo '{"presets": ["flow"]}' > .babelrc
// @flow
// index.js
import type { OpenAPI } from 'openapi3-flowtype-definition'
const openAPI: OpenAPI = {
openapi: '3.0',
info: {
title: 'test',
version: '0.1',
},
paths: {},
}
console.log(JSON.stringify(openAPI))
you typecheck and generate json
yarn flow && babel-node index.js
Links
- openapi-flowtype-definition
- Spported OpenAPI 2.0)