New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

flow-swag

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-swag

Flow Type generator for Swagger specifications

latest
npmnpm
Version
1.4.0
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Open API Flow Type Generator

Generate Flow types from the Open API spec.

Installation

yarn global add flow-swag

Usage

fswag ./pet_store.yaml -p ./.prettierrc -o types.js

Outputs:

// @flow
export type Category = {
  id: number,
  name: string,
}

export type Tag = {
  id: number,
  name: string,
}

export type Pet = {
  id: number,
  category: Category,
  name: string,
  photoUrls: string[],
  tags: Tag[],
  status: 'available' | 'pending' | 'sold',
}

// ...

API

The source file can be YAML or JSON.

$ flow-swag -h

Usage: flow-swag [options] <source>

Options:
  -o, --output <file>                 output file (default: "types.js")
  -p, --prettierConfig <.prettierrc>  prettier configuration file
  -c, --camelizeKeys                  camelCase property names
  -h, --help                          output usage information

FAQs

Package last updated on 03 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts