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
npm install --save-dev openapi3-flowtype-definition
or
yarn add --dev openapi3-flowtype-definition
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
- openapi-flowtype-definition
- Spported OpenAPI 2.0)