3.1.1 • Published 4 years ago

swagger2-postman-doc v3.1.1

Weekly downloads
36
License
MIT
Repository
github
Last release
4 years ago

swagger2-postman-doc

CLI tool to generate Postman Documentation from Swagger and update a Collection.

oclif Version Downloads/week License

Description

Postman supports syncing schema syncing with GitHub but currently requires the manual generation of a documentation collection from the schema. Codified schema updates therefore create a new collection each sync or manually validating the schema to sync, necessitating another process of reconciling updates with published documentation.

This tool does the following:

  1. Updates a Postman API schema with a given Swagger definition.
  2. Converts the Swagger definition into OpenAPI 3 using swagger2openapi.
  3. Converts the OpenAPI definition into a Postman Collection using openapi-to-postman.
  4. Updates given Documentation Collection with the converted one.

Usage

$ npm install -g swagger2-postman-doc
$ swagger2-postman-doc COMMAND
running command...
$ swagger2-postman-doc (-v|--version|version)
swagger2-postman-doc/3.1.1 darwin-x64 node-v12.14.1
$ swagger2-postman-doc --help [COMMAND]
USAGE
  $ swagger2-postman-doc COMMAND
...

Commands

swagger2-postman-doc hapi HOST

Generate Swagger from Hapi Swagger.

USAGE
  $ swagger2-postman-doc hapi HOST

ARGUMENTS
  HOST  Hapi Swagger host

OPTIONS
  -h, --help           show CLI help
  -o, --output=output  swagger output path

See code: src/commands/hapi.ts

swagger2-postman-doc help [COMMAND]

display help for swagger2-postman-doc

USAGE
  $ swagger2-postman-doc help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

swagger2-postman-doc postman FILE APIKEY APIID APIVERSIONID SCHEMAID COLLECTIONUID

Generate Postman Documentation from Swagger and update a Collection.

USAGE
  $ swagger2-postman-doc postman FILE APIKEY APIID APIVERSIONID SCHEMAID COLLECTIONUID

ARGUMENTS
  FILE           Path to Swagger file
  APIKEY         Postman API key
  APIID          Postman API Id
  APIVERSIONID   Postman API Version Id
  SCHEMAID       Postman API Schema Id
  COLLECTIONUID  Postman API Documentation Collection Uid

OPTIONS
  -h, --help                                    show CLI help
  -o, --output=output                           Postman Collection output path

  --exampleParametersResolution=schema|example  [default: example] Swagger to Postman Collection: generate the response
                                                parameters based on the schema or example

  --folderStrategy=paths|tags                   [default: tags] Swagger to Postman Collection: create folders according
                                                to the spec’s paths or tags

  --requestParametersResolution=schema|example  [default: schema] Swagger to Postman Collection: generate the request
                                                parameters based on the schema or example

See code: src/commands/postman.ts