1.0.0 • Published 5 years ago

api-organizer v1.0.0

Weekly downloads
5
License
Apache-2.0
Repository
github
Last release
5 years ago

api-catalog-organizer

   ('-.      _ (`-.
  ( OO ).-. ( (OO  )
  / . --. /_.`     \ ,-.-')
  | \-.  \(__...--'' |  |OO)
.-'-'  |  ||  /  | | |  |  \
 \| |_.'  ||  |_.' | |  |(_/
  |  .-.  ||  .___.',|  |_.'
  |  | |  ||  |    (_|  |
  `--' `--'`--'      `--'
   ___                        _
  / _ \ _ __ __ _  __ _ _ __ (_)_______ _ __
 | | | | '__/ _` |/ _` | '_ \| |_  / _ \ '__|
 | |_| | | | (_| | (_| | | | | |/ /  __/ |
  \___/|_|  \__, |\__,_|_| |_|_/___\___|_|
            |___/

An interactive command-line tool to manage API Catalogs
Version: 1.0.0

An interactive command-line tool to manage API Catalogs.

api-catalog-organizer is tool to manage REST API catalogs.

Currently it is supporting below operations:

  1. Extract API endpoints from a Swagger document using a tag.
  2. Allows to add a parameter (header or query) to all API endpoints of a Swagger document.
  3. Allows to remove a paramter (header or query) from API endpoints of a Swagger document.
  4. Allows to modify API endpoints by prepending an arbitrary text (like version number: "/v1")

The tools has following features:

  • Supports both JSON (.json extension) and YAML (both .yaml & .yml extensions) formats.
  • Able to control the format of the output file.
  • Supports for adding Authorization Header automatically to each extracted endpoints.
  • The supplied tag will be removed from output file as it is redundant.

Install

Make sure you have installed latest version of Node.js

$ npm install -g api-organizer

Usage

$ api-organizer --help

  Usage: app [options] [command]

  Options:

    -V, --version  output the version number
    -h, --help     output usage information

  Commands:

    extract        extract API endpoints from a Swagger document using a tag
    param          allows to add/remove a parameter (header or query). use "add" and "remove" sub commands
    prepend        allows to modify API endpoints by prepending an arbitrary text (like version number: "/v1")
    help [cmd]     display help for [cmd]

Available Commands and Sub Commands

extract

api-organizer extract

Allows to extract API endpoints from an existing Swagger document by specifying a tag name. When you invoke this command, it will ask few questions to collect below configurations for extracting endpoints.

configurationDescriptionExample Input
Path to API documentSpecify the relative or absolute path to your Swagger API document (should be in JSON or YAML format)home/projects/petstore-swagger.json
Output file nameSpecify the name for the output file. If you specify the extension (as .json, .yaml or .yml) the output format will be in that formatpublic-petstore-api-swagger.yaml
Tag nameThe tag name to extract API end pointsPublic
Authorization headerSpecify whether to add Authorization header to all endpointn

param add

api-organizer param add

Allows to add a new parameter (header or query) to all the endpoints of a Swagger document. When you invoke this command, it will ask few questions to collect below configurations for adding the parameter.

configurationDescriptionExample Input
Path to API documentSpecify the relative or absolute path to your Swagger API document (should be in JSON or YAML format)home/projects/petstore-swagger.json
Output file nameSpecify the name for the output file. If you specify the extension (as .json, .yaml or .yml) the output format will be in that formatpublic-petstore-api-swagger.yaml
Parameter nameThe name for the parameter to be addedX-API-KEY
DescriptionThe description for the paramterAPI Key for authentication
Parameter typeSelect the type of the paramter as query or header using arrow keysheader
Data typeSelect the dat type for the paramter using arrow keysstring
Is mandatorySpecify whether the paramter is a mandatory or optionaly

param remove

api-organizer param remove

Allows to remove a parameter (header or query) from all the endpoints of a Swagger document. When you invoke this command, it will ask few questions to collect below configurations for adding the parameter.

configurationDescriptionExample Input
Path to API documentSpecify the relative or absolute path to your Swagger API document (should be in JSON or YAML format)home/projects/petstore-swagger.json
Output file nameSpecify the name for the output file. If you specify the extension (as .json, .yaml or .yml) the output format will be in that formatpublic-petstore-api-swagger.yaml
Parameter nameThe name for the parameter to be removedX-API-KEY

prepend

api-organizer prepend

Allows to modify API endpoints by prepending an arbitrary text (like version number: "/v1"). When you invoke this command, it will ask few questions to collect below configurations for prepending endpoints.

configurationDescriptionExample Input
Path to API documentSpecify the relative or absolute path to your Swagger API document (should be in JSON or YAML format)home/projects/petstore-swagger.json
Output file nameSpecify the name for the output file. If you specify the extension (as .json, .yaml or .yml) the output format will be in that formatpublic-petstore-api-swagger.yaml
Text to prependThe text to prepend to all API end points/v1

help

api-organizer help [cmd]

Displays the help for the available commands and sub commands.