1.4.0 • Published 5 years ago

flow-swag v1.4.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

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
1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago