Skip to content

bacher/openapi-api-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openapi Api Generator

Usage:

$ ts-node src/run.ts --help
Options:
  -h, --help       Show help                                           [boolean]
  -v, --version    Show version number                                 [boolean]
  -o, --out        Output directory                             [default: ./out]
      --namespace  Typescript namespace for API types              [default: ""]
      --use-enums  Use Typescript enums for openapi enum values
                                                      [boolean] [default: false]

Examples:
  openapi-api-generator api/openapi.yaml                       Process api/openapi.yaml file
  openapi-api-generator -o ./gen api/openapi.yaml              Collect generated api in ./gen directory
  openapi-api-generator -o ./gen api/openapi.yaml --use-enums  Generate api with enums

Example

$ npx openapi-api-generator --out api examples/openapi.yaml

Output:

Success (files have been generated):
  * out/types.ts
  * out/api.ts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published