Api2Swagger : Open API (Swagger) 2.0 Spec Generator - Command line tool

Hello Everyone,

UPDATE : We now have UI tool hosted online to generate OpenApi Spec (Swagger). Find more about same here.

We now have a new exciting tool related to swagger called api2swagger . We all love swagger, which is now called Open API. It's a simple yet powerful representation of your RESTful API. It helps you document your APIs and use it during the entire life cycle of working with REST APIs.

It helps you many ways like,

  • Generate beautiful docs using Swagger UI
  • Generate documentation in Apigee Developer Portal using smartdocs feature
  • Test & Monitor your APIs using Apigee Health
  • Create API Proxies using swagger2api tool in Apigee Edge
  • Generate SDK for various languages using Swagger Code Gen

Many other tools also support swagger 2.0 specifications like postman etc etc...

To do all above, we need to write a swagger specification for our existing / new REST APIs. I am sure many of you agree, writing swagger 2.0 specifications from scratch is so painful. Because, You need to deal with so many lines of code & complex nested structures.

Let's say, we need to write swagger specifications for few simple API calls like Apigee Developer Edge Management APIs listed here. If you start writing swagger spec for few of these API calls it will come around 1000 lines of code. Think about how much time it will take to fiddle with highly complex JSON structure. Swagger specification for above API calls will look like below code.

{
  "swagger": "2.0",
  "host": "api.enterprise.apigee.com",
  "schemes": [
    "https",
    "http"
  ],
  "info": {
    "description": "Apigee Edge Management Apis Open API 2.0 (Swagger) Spec",
    "title": "Apigee Edge APIs",
    "version": "0.0.1",
    "termsOfService": "http://apigee.com/about/terms",
    "contact": {
      "name": "Apigee Docs",
      "url": "http://apigee.com/about/apigee#block-bean-about-apigee-contact-us-header",
      "email": "docs@apigee.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://apigee.com"
    }
  },
  "basePath": "/v1",
  "paths": {
    "/organizations/{organization}/developers": {
      "post": {
        "description": "Create Developer",
        "summary": "Creates a profile for a developer in an organization. Once created, the developer can register an app and receive an API key.",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers"
        },
        "operationId": "createDeveloper",
        "tags": [
          "developers"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "apps": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "developerId": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "organizationName": {
                  "type": "string",
                  "minLength": 1
                },
                "status": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "uniqueItems": true,
                  "minItems": 1,
                  "items": {
                    "required": [
                      "name",
                      "value"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                },
                "createdAt": {
                  "type": "number"
                },
                "createdBy": {
                  "type": "string",
                  "minLength": 1
                },
                "lastModifiedAt": {
                  "type": "number"
                },
                "lastModifiedBy": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "apps",
                "email",
                "developerId",
                "firstName",
                "lastName",
                "userName",
                "organizationName",
                "status",
                "attributes",
                "createdAt",
                "createdBy",
                "lastModifiedAt",
                "lastModifiedBy"
              ]
            }
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Content-Type",
            "description": "Request Content Type",
            "required": true,
            "type": "string",
            "enum": [
              "application/json"
            ]
          },
          {
            "in": "body",
            "name": "body",
            "description": "Request Payload",
            "required": true,
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "uniqueItems": true,
                  "minItems": 1,
                  "items": {
                    "required": [
                      "name",
                      "value"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                }
              },
              "required": [
                "email",
                "firstName",
                "lastName",
                "userName",
                "attributes"
              ]
            }
          },
          {
            "in": "path",
            "name": "organization",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          }
        ]
      },
      "get": {
        "description": "List Developers",
        "summary": "List all Developers in an Organization",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/developers"
        },
        "operationId": "listDevelopers",
        "tags": [
          "developers"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "array",
              "description": "",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "object",
                "properties": {
                }
              }
            }
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "organization",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          }
        ]
      }
    },
    "/organizations/{organization}/developers/{developerEmail}": {
      "delete": {
        "description": "Delete Developer",
        "summary": "Deletes a developer from an organization. All apps associated with the developer are also removed from the organization.",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/delete/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D"
        },
        "operationId": "deleteDeveloper",
        "tags": [
          "developers"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "apps": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "developerId": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "organizationName": {
                  "type": "string",
                  "minLength": 1
                },
                "status": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "createdAt": {
                  "type": "number"
                },
                "createdBy": {
                  "type": "string",
                  "minLength": 1
                },
                "lastModifiedAt": {
                  "type": "number"
                },
                "lastModifiedBy": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "apps",
                "email",
                "developerId",
                "firstName",
                "lastName",
                "userName",
                "organizationName",
                "status",
                "attributes",
                "createdAt",
                "createdBy",
                "lastModifiedAt",
                "lastModifiedBy"
              ]
            }
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "organization",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          },
          {
            "in": "path",
            "name": "developerEmail",
            "description": "Developer Email Address",
            "required": true,
            "type": "string"
          }
        ]
      },
      "get": {
        "description": "Get Developers",
        "summary": "Returns the profile for a developer by email address or ID. All time values are UNIX time values. The profile includes the developer's email address, ID, name, and other information.",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D"
        },
        "operationId": "getDeveloper",
        "tags": [
          "developers"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "apps": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "companies": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "developerId": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "organizationName": {
                  "type": "string",
                  "minLength": 1
                },
                "status": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "createdAt": {
                  "type": "number"
                },
                "createdBy": {
                  "type": "string",
                  "minLength": 1
                },
                "lastModifiedAt": {
                  "type": "number"
                },
                "lastModifiedBy": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "apps",
                "companies",
                "email",
                "developerId",
                "firstName",
                "lastName",
                "userName",
                "organizationName",
                "status",
                "attributes",
                "createdAt",
                "createdBy",
                "lastModifiedAt",
                "lastModifiedBy"
              ]
            }
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "organization",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          },
          {
            "in": "path",
            "name": "developerEmail",
            "description": "Developer Email Address",
            "required": true,
            "type": "string"
          }
        ]
      },
      "put": {
        "description": "Update Developer",
        "summary": "Update an existing developer profile.",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/put/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D"
        },
        "operationId": "updateDeveloper",
        "tags": [
          "developers"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "apps": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "companies": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "developerId": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "organizationName": {
                  "type": "string",
                  "minLength": 1
                },
                "status": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "uniqueItems": true,
                  "minItems": 1,
                  "items": {
                    "required": [
                      "name",
                      "value"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                },
                "createdAt": {
                  "type": "number"
                },
                "createdBy": {
                  "type": "string",
                  "minLength": 1
                },
                "lastModifiedAt": {
                  "type": "number"
                },
                "lastModifiedBy": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "apps",
                "companies",
                "email",
                "developerId",
                "firstName",
                "lastName",
                "userName",
                "organizationName",
                "status",
                "attributes",
                "createdAt",
                "createdBy",
                "lastModifiedAt",
                "lastModifiedBy"
              ]
            }
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Content-Type",
            "description": "Request Content Type",
            "required": true,
            "type": "string",
            "enum": [
              "application/json"
            ]
          },
          {
            "in": "body",
            "name": "body",
            "description": "Request Payload",
            "required": true,
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "uniqueItems": true,
                  "minItems": 1,
                  "items": {
                    "required": [
                      "name",
                      "value"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "value": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                }
              },
              "required": [
                "email",
                "firstName",
                "lastName",
                "userName",
                "attributes"
              ]
            }
          },
          {
            "in": "path",
            "name": "organization",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          },
          {
            "in": "path",
            "name": "developerEmail",
            "description": "Developer Email Address",
            "required": true,
            "type": "string"
          }
        ]
      },
      "post": {
        "description": "Set Developer Status",
        "summary": "Sets a developer's status to active, inactive, or login_lock.",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D"
        },
        "operationId": "setDeveloperStatus",
        "tags": [
          "developers"
        ],
        "produces": [
          "*/*"
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "action",
            "description": "Set to active, inactive, or login_lock.",
            "type": "string",
            "required": true,
            "enum": [
              "inactive",
              "active",
              "login_block"
            ]
          },
          {
            "in": "header",
            "name": "Content-Type",
            "description": "Request Content Type",
            "required": true,
            "type": "string",
            "enum": [
              "application/octet-stream"
            ]
          },
          {
            "in": "path",
            "name": "organization",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          },
          {
            "in": "path",
            "name": "developerEmail",
            "description": "Developer Email Address",
            "required": true,
            "type": "string"
          }
        ]
      }
    },
    "/organizations/{org}/developers/{developerEmail}": {
      "get": {
        "description": "Get Developer By App",
        "summary": "Gets the developer profile by app name. The profile retrieved is for the developer associated with the app in the organization. ",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/developers-0"
        },
        "operationId": "getDeveloperByApp",
        "tags": [
          "developers"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "apps": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "companies": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "email": {
                  "type": "string",
                  "minLength": 1
                },
                "developerId": {
                  "type": "string",
                  "minLength": 1
                },
                "firstName": {
                  "type": "string",
                  "minLength": 1
                },
                "lastName": {
                  "type": "string",
                  "minLength": 1
                },
                "userName": {
                  "type": "string",
                  "minLength": 1
                },
                "organizationName": {
                  "type": "string",
                  "minLength": 1
                },
                "status": {
                  "type": "string",
                  "minLength": 1
                },
                "attributes": {
                  "type": "array",
                  "items": {
                    "properties": {
                    }
                  }
                },
                "createdAt": {
                  "type": "number"
                },
                "createdBy": {
                  "type": "string",
                  "minLength": 1
                },
                "lastModifiedAt": {
                  "type": "number"
                },
                "lastModifiedBy": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "apps",
                "companies",
                "email",
                "developerId",
                "firstName",
                "lastName",
                "userName",
                "organizationName",
                "status",
                "attributes",
                "createdAt",
                "createdBy",
                "lastModifiedAt",
                "lastModifiedBy"
              ]
            }
          }
        },
        "security": [
          {
            "basicAuth": [


            ]
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "description": "Developer App Name",
            "type": "string",
            "required": true,
            "enum": [
              "appName"
            ]
          },
          {
            "in": "path",
            "name": "org",
            "description": "Apigee Edge Org Name",
            "required": true,
            "type": "string"
          },
          {
            "in": "path",
            "name": "developerEmail",
            "description": "Developer Email Address",
            "required": true,
            "type": "string"
          }
        ]
      }
    }
  },
  "securityDefinitions": {
    "basicAuth": {
      "type": "basic",
      "description": "HTTP Basic Authentication. Works over `HTTP` and `HTTPS`"
    }
  }
}

I am sure, you might have taken few seconds to scroll down above code. Think about writing this code & maintaining it 🙂

What if I tell you above code is auto generated using a tool within few minutes using simple CURL like syntax ? I am sure it's going to save a lot of time, change the way you document your APIs & manage your APIs. Above Swagger spec is generated using API2Swagger Node.js based command line tool.

Installation

Installing api2swagger is as simple as any other node module from NPM. Requirements to use this tool are Node.JS and NPM. You can install this tool by running the following command after you have Node.JS and NPM installed on your local machine.

$ sudo npm install -g api2swagger

Once you have api2swagger installed, you are ready to generate a Swagger 2.0 spec from CURL like commands.

How to use api2swagger

Api2swagger supports GET, POST, PUT, DELETE methods and you just need to make a CURL like api call and answer some questions. Api2swagger supports incremental update of swagger spec for same basepath.

Let's generate swagger 2.0 spec for Google Books API to understand how Api2Swagger works. We are going to generate swagger 2.0 spec for below mentioned API calls.

GET https://www.googleapis.com/books/v1/volumes?q=quilting

GET https://www.googleapis.com/books/v1/volumes/{VOLUMEID}

api2swagger command line options are similar to CURL command line tool. Let's make the first API call & generate swagger 2.0 spec for Google Books API.

$ api2swagger -e "https://www.googleapis.com/books/v1/volumes?q=quilting" -o /Users/Anil/Desktop/googleBooks.json -X GET

-e : (EndPoint) : It's used to specify end point. It also support username, password basic authentication sent in URI. Like https://username:password@example.com

-X : (HTTP Method) : GET, POST, PUT , DELETE supported

-o : (Output) : Location of new swagger json file yet to be created / existing swagger spec to update new method / resource.

-d : (data) : Payload , Form Data used in POST, PUT, DELETE

-H : (Headers) : Request headers

Once you run above command, it asks for few details like Title of swagger spec, Contact Information etc..

1767-screen-shot-2016-01-11-at-102830-am.png

Then you will be asked for details regarding your rest API like, Does your API supports http / https , base path of your API.

1768-screen-shot-2016-01-11-at-103038-am.png

Options for basePath will be automatically populated from your API call. After that, you will be asked for details of the API Method,

1769-screen-shot-2016-01-11-at-103301-am.png

After collecting few more details, An API call is made to fetch runtime information like request response.

1770-screen-shot-2016-01-11-at-105301-am.png

If everything goes as planned, you will see below message,

Swagger JSON File successfully generated in : /Users/Anil/Desktop/googleBooks.json

Let's open up googleBooks.json and see the content, it should look like below.

{
  "swagger": "2.0",
  "host": "www.googleapis.com",
  "schemes": [
    "https",
    "http"
  ],
  "info": {
    "description": "Swagger 2.0 Specification for Google Books API",
    "title": "Google Books API",
    "version": "0.0.1",
    "termsOfService": "http://example.com/about/terms",
    "contact": {
      "name": "API Docs",
      "url": "http://example.com/contact",
      "email": "apidocs@example.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://example.com"
    }
  },
  "basePath": "/books/v1",
  "paths": {
    "/volumes": {
      "get": {
        "description": "Book Volumes API",
        "summary": "Search for book volumes using search string",
        "externalDocs": {
          "description": "Find out more",
          "url": "https://developers.google.com/books/docs/v1/getting_started"
        },
        "operationId": "searchVolumes",
        "tags": [
          "google",
          " books"
        ],
        "produces": [
          "application/json; charset=UTF-8"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1
                },
                "totalItems": {
                  "type": "number"
                },
                "items": {
                  "type": "array",
                  "uniqueItems": true,
                  "minItems": 1,
                  "items": {
                    "required": [
                      "kind",
                      "id",
                      "etag",
                      "selfLink"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "minLength": 1
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "etag": {
                        "type": "string",
                        "minLength": 1
                      },
                      "selfLink": {
                        "type": "string",
                        "minLength": 1
                      },
                      "volumeInfo": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string",
                            "minLength": 1
                          },
                          "subtitle": {
                            "type": "string",
                            "minLength": 1
                          },
                          "authors": {
                            "type": "array",
                            "items": {
                              "properties": {}
                            }
                          },
                          "publisher": {
                            "type": "string",
                            "minLength": 1
                          },
                          "publishedDate": {
                            "type": "string",
                            "minLength": 1
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1
                          },
                          "industryIdentifiers": {
                            "type": "array",
                            "uniqueItems": true,
                            "minItems": 1,
                            "items": {
                              "required": [
                                "type",
                                "identifier"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "identifier": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            }
                          },
                          "readingModes": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "boolean"
                              },
                              "image": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "text",
                              "image"
                            ]
                          },
                          "pageCount": {
                            "type": "number"
                          },
                          "printType": {
                            "type": "string",
                            "minLength": 1
                          },
                          "categories": {
                            "type": "array",
                            "items": {
                              "properties": {}
                            }
                          },
                          "averageRating": {
                            "type": "number"
                          },
                          "ratingsCount": {
                            "type": "number"
                          },
                          "maturityRating": {
                            "type": "string",
                            "minLength": 1
                          },
                          "allowAnonLogging": {
                            "type": "boolean"
                          },
                          "contentVersion": {
                            "type": "string",
                            "minLength": 1
                          },
                          "imageLinks": {
                            "type": "object",
                            "properties": {
                              "smallThumbnail": {
                                "type": "string",
                                "minLength": 1
                              },
                              "thumbnail": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "smallThumbnail",
                              "thumbnail"
                            ]
                          },
                          "language": {
                            "type": "string",
                            "minLength": 1
                          },
                          "previewLink": {
                            "type": "string",
                            "minLength": 1
                          },
                          "infoLink": {
                            "type": "string",
                            "minLength": 1
                          },
                          "canonicalVolumeLink": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "title",
                          "subtitle",
                          "authors",
                          "publisher",
                          "publishedDate",
                          "description",
                          "industryIdentifiers",
                          "readingModes",
                          "pageCount",
                          "printType",
                          "categories",
                          "averageRating",
                          "ratingsCount",
                          "maturityRating",
                          "allowAnonLogging",
                          "contentVersion",
                          "imageLinks",
                          "language",
                          "previewLink",
                          "infoLink",
                          "canonicalVolumeLink"
                        ]
                      },
                      "saleInfo": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string",
                            "minLength": 1
                          },
                          "saleability": {
                            "type": "string",
                            "minLength": 1
                          },
                          "isEbook": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "country",
                          "saleability",
                          "isEbook"
                        ]
                      },
                      "accessInfo": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string",
                            "minLength": 1
                          },
                          "viewability": {
                            "type": "string",
                            "minLength": 1
                          },
                          "embeddable": {
                            "type": "boolean"
                          },
                          "publicDomain": {
                            "type": "boolean"
                          },
                          "textToSpeechPermission": {
                            "type": "string",
                            "minLength": 1
                          },
                          "epub": {
                            "type": "object",
                            "properties": {
                              "isAvailable": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "isAvailable"
                            ]
                          },
                          "pdf": {
                            "type": "object",
                            "properties": {
                              "isAvailable": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "isAvailable"
                            ]
                          },
                          "webReaderLink": {
                            "type": "string",
                            "minLength": 1
                          },
                          "accessViewStatus": {
                            "type": "string",
                            "minLength": 1
                          },
                          "quoteSharingAllowed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "country",
                          "viewability",
                          "embeddable",
                          "publicDomain",
                          "textToSpeechPermission",
                          "epub",
                          "pdf",
                          "webReaderLink",
                          "accessViewStatus",
                          "quoteSharingAllowed"
                        ]
                      },
                      "searchInfo": {
                        "type": "object",
                        "properties": {
                          "textSnippet": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "textSnippet"
                        ]
                      }
                    }
                  }
                }
              },
              "required": [
                "kind",
                "totalItems",
                "items"
              ]
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "description": "Query String",
            "type": "string",
            "required": true,
            "enum": [
              "quilting"
            ]
          }
        ]
      }
    }
  }
}

You got a swagger spec for google books API. Let's copy this to apistudio.io to see generated swagger in action.

1771-screen-shot-2016-01-11-at-105738-am.png

Generated swagger is working like a charm & you got the documentation for Google Books API.

Let's add more paths / api methods to our google docs swagger 2.0 spec.

$ api2swagger -e "https://www.googleapis.com/books/v1/volumes/s1gVAAAAYAAJ" -o /Users/Anil/Desktop/googleBooks.json -X GET

This time, since base path and hostname matches you don't need to enter high level info. Only method related information need to be provided.

http://i.imgur.com/7thtwBf.png

Provide more details regarding url parameter,

http://i.imgur.com/kNxnhr3.png

That's it, new API path will be appended to existing swagger,

{
  "swagger": "2.0",
  "host": "www.googleapis.com",
  "schemes": [
    "https",
    "http"
  ],
  "info": {
    "description": "Swagger 2.0 Specification for Google Books API",
    "title": "Google Books API",
    "version": "0.0.1",
    "termsOfService": "http://example.com/about/terms",
    "contact": {
      "name": "API Docs",
      "url": "http://example.com/contact",
      "email": "apidocs@example.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://example.com"
    }
  },
  "basePath": "/books/v1",
  "paths": {
    "/volumes": {
      "get": {
        "description": "Book Volumes API",
        "summary": "Search for book volumes using search string",
        "externalDocs": {
          "description": "Find out more",
          "url": "https://developers.google.com/books/docs/v1/getting_started"
        },
        "operationId": "searchVolumes",
        "tags": [
          "google",
          " books"
        ],
        "produces": [
          "application/json; charset=UTF-8"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1
                },
                "totalItems": {
                  "type": "number"
                },
                "items": {
                  "type": "array",
                  "uniqueItems": true,
                  "minItems": 1,
                  "items": {
                    "required": [
                      "kind",
                      "id",
                      "etag",
                      "selfLink"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "minLength": 1
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "etag": {
                        "type": "string",
                        "minLength": 1
                      },
                      "selfLink": {
                        "type": "string",
                        "minLength": 1
                      },
                      "volumeInfo": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string",
                            "minLength": 1
                          },
                          "subtitle": {
                            "type": "string",
                            "minLength": 1
                          },
                          "authors": {
                            "type": "array",
                            "items": {
                              "properties": {}
                            }
                          },
                          "publisher": {
                            "type": "string",
                            "minLength": 1
                          },
                          "publishedDate": {
                            "type": "string",
                            "minLength": 1
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1
                          },
                          "industryIdentifiers": {
                            "type": "array",
                            "uniqueItems": true,
                            "minItems": 1,
                            "items": {
                              "required": [
                                "type",
                                "identifier"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "identifier": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              }
                            }
                          },
                          "readingModes": {
                            "type": "object",
                            "properties": {
                              "text": {
                                "type": "boolean"
                              },
                              "image": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "text",
                              "image"
                            ]
                          },
                          "pageCount": {
                            "type": "number"
                          },
                          "printType": {
                            "type": "string",
                            "minLength": 1
                          },
                          "categories": {
                            "type": "array",
                            "items": {
                              "properties": {}
                            }
                          },
                          "averageRating": {
                            "type": "number"
                          },
                          "ratingsCount": {
                            "type": "number"
                          },
                          "maturityRating": {
                            "type": "string",
                            "minLength": 1
                          },
                          "allowAnonLogging": {
                            "type": "boolean"
                          },
                          "contentVersion": {
                            "type": "string",
                            "minLength": 1
                          },
                          "imageLinks": {
                            "type": "object",
                            "properties": {
                              "smallThumbnail": {
                                "type": "string",
                                "minLength": 1
                              },
                              "thumbnail": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "smallThumbnail",
                              "thumbnail"
                            ]
                          },
                          "language": {
                            "type": "string",
                            "minLength": 1
                          },
                          "previewLink": {
                            "type": "string",
                            "minLength": 1
                          },
                          "infoLink": {
                            "type": "string",
                            "minLength": 1
                          },
                          "canonicalVolumeLink": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "title",
                          "subtitle",
                          "authors",
                          "publisher",
                          "publishedDate",
                          "description",
                          "industryIdentifiers",
                          "readingModes",
                          "pageCount",
                          "printType",
                          "categories",
                          "averageRating",
                          "ratingsCount",
                          "maturityRating",
                          "allowAnonLogging",
                          "contentVersion",
                          "imageLinks",
                          "language",
                          "previewLink",
                          "infoLink",
                          "canonicalVolumeLink"
                        ]
                      },
                      "saleInfo": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string",
                            "minLength": 1
                          },
                          "saleability": {
                            "type": "string",
                            "minLength": 1
                          },
                          "isEbook": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "country",
                          "saleability",
                          "isEbook"
                        ]
                      },
                      "accessInfo": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string",
                            "minLength": 1
                          },
                          "viewability": {
                            "type": "string",
                            "minLength": 1
                          },
                          "embeddable": {
                            "type": "boolean"
                          },
                          "publicDomain": {
                            "type": "boolean"
                          },
                          "textToSpeechPermission": {
                            "type": "string",
                            "minLength": 1
                          },
                          "epub": {
                            "type": "object",
                            "properties": {
                              "isAvailable": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "isAvailable"
                            ]
                          },
                          "pdf": {
                            "type": "object",
                            "properties": {
                              "isAvailable": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "isAvailable"
                            ]
                          },
                          "webReaderLink": {
                            "type": "string",
                            "minLength": 1
                          },
                          "accessViewStatus": {
                            "type": "string",
                            "minLength": 1
                          },
                          "quoteSharingAllowed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "country",
                          "viewability",
                          "embeddable",
                          "publicDomain",
                          "textToSpeechPermission",
                          "epub",
                          "pdf",
                          "webReaderLink",
                          "accessViewStatus",
                          "quoteSharingAllowed"
                        ]
                      },
                      "searchInfo": {
                        "type": "object",
                        "properties": {
                          "textSnippet": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "textSnippet"
                        ]
                      }
                    }
                  }
                }
              },
              "required": [
                "kind",
                "totalItems",
                "items"
              ]
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "description": "Query String",
            "type": "string",
            "required": true,
            "enum": [
              "quilting"
            ]
          }
        ]
      }
    },
    "/volumes/{volumeId}": {
      "get": {
        "description": "Volume Info",
        "summary": "Get Book Volume Details",
        "externalDocs": {
          "description": "Find out more",
          "url": "http://docs.example.com/management/apis/get/entities"
        },
        "operationId": "getVolumeInfo",
        "tags": [
          "google",
          " books"
        ],
        "produces": [
          "application/json; charset=UTF-8"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "minLength": 1
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "etag": {
                  "type": "string",
                  "minLength": 1
                },
                "selfLink": {
                  "type": "string",
                  "minLength": 1
                },
                "volumeInfo": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "minLength": 1
                    },
                    "authors": {
                      "type": "array",
                      "items": {
                        "properties": {}
                      }
                    },
                    "publisher": {
                      "type": "string",
                      "minLength": 1
                    },
                    "publishedDate": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1
                    },
                    "readingModes": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "boolean"
                        },
                        "image": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "text",
                        "image"
                      ]
                    },
                    "pageCount": {
                      "type": "number"
                    },
                    "printedPageCount": {
                      "type": "number"
                    },
                    "dimensions": {
                      "type": "object",
                      "properties": {
                        "height": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "height"
                      ]
                    },
                    "printType": {
                      "type": "string",
                      "minLength": 1
                    },
                    "averageRating": {
                      "type": "number"
                    },
                    "ratingsCount": {
                      "type": "number"
                    },
                    "maturityRating": {
                      "type": "string",
                      "minLength": 1
                    },
                    "allowAnonLogging": {
                      "type": "boolean"
                    },
                    "contentVersion": {
                      "type": "string",
                      "minLength": 1
                    },
                    "imageLinks": {
                      "type": "object",
                      "properties": {
                        "smallThumbnail": {
                          "type": "string",
                          "minLength": 1
                        },
                        "thumbnail": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "smallThumbnail",
                        "thumbnail"
                      ]
                    },
                    "language": {
                      "type": "string",
                      "minLength": 1
                    },
                    "previewLink": {
                      "type": "string",
                      "minLength": 1
                    },
                    "infoLink": {
                      "type": "string",
                      "minLength": 1
                    },
                    "canonicalVolumeLink": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "title",
                    "authors",
                    "publisher",
                    "publishedDate",
                    "description",
                    "readingModes",
                    "pageCount",
                    "printedPageCount",
                    "dimensions",
                    "printType",
                    "averageRating",
                    "ratingsCount",
                    "maturityRating",
                    "allowAnonLogging",
                    "contentVersion",
                    "imageLinks",
                    "language",
                    "previewLink",
                    "infoLink",
                    "canonicalVolumeLink"
                  ]
                },
                "layerInfo": {
                  "type": "object",
                  "properties": {
                    "layers": {
                      "type": "array",
                      "uniqueItems": true,
                      "minItems": 1,
                      "items": {
                        "required": [
                          "layerId",
                          "volumeAnnotationsVersion"
                        ],
                        "properties": {
                          "layerId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "volumeAnnotationsVersion": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "layers"
                  ]
                },
                "saleInfo": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": "string",
                      "minLength": 1
                    },
                    "saleability": {
                      "type": "string",
                      "minLength": 1
                    },
                    "isEbook": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "country",
                    "saleability",
                    "isEbook"
                  ]
                },
                "accessInfo": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": "string",
                      "minLength": 1
                    },
                    "viewability": {
                      "type": "string",
                      "minLength": 1
                    },
                    "embeddable": {
                      "type": "boolean"
                    },
                    "publicDomain": {
                      "type": "boolean"
                    },
                    "textToSpeechPermission": {
                      "type": "string",
                      "minLength": 1
                    },
                    "epub": {
                      "type": "object",
                      "properties": {
                        "isAvailable": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "isAvailable"
                      ]
                    },
                    "pdf": {
                      "type": "object",
                      "properties": {
                        "isAvailable": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "isAvailable"
                      ]
                    },
                    "webReaderLink": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accessViewStatus": {
                      "type": "string",
                      "minLength": 1
                    },
                    "quoteSharingAllowed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "country",
                    "viewability",
                    "embeddable",
                    "publicDomain",
                    "textToSpeechPermission",
                    "epub",
                    "pdf",
                    "webReaderLink",
                    "accessViewStatus",
                    "quoteSharingAllowed"
                  ]
                }
              },
              "required": [
                "kind",
                "id",
                "etag",
                "selfLink",
                "volumeInfo",
                "layerInfo",
                "saleInfo",
                "accessInfo"
              ]
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "volumeId",
            "description": "Volume Id",
            "required": true,
            "type": "string"
          }
        ]
      }
    }
  }
}



http://i.imgur.com/j6tX9RD.png

API2Swagger currently support only JSON / plain text based request / response. As of today, API2Swagger doesn't support all use cases. I can say 70 - 80 % use cases are covered.

Stay tuned, we will be using this tool to generate swagger 2.0 spec for Management APIs which in turn helps to generate SDKs for Apigee Management APIs. Please keep us posted & share your feedback.

Important :

Api2swagger 0.1.2 release is an alpha release. Please feel free to log issues / comments / improvement request in github here. I am also looking for co-maintainer for this project. Please contact me if anyone interested using comments section.

Comments
anilsr
Staff

@Kurt Kanaskie @kurtkanaskie @Thomas Lippuner @docs @Rajat Agarwal , I am sure you are interested to hear about this new swagger tool. Keep us posted.

Not applicable

This is exactly what I was looking for. Let me try it and share with the community my experience. Thanks @Anil Sagar

anilsr
Staff

Thank you @Diego Zuluaga , Looking forward to valuable feedback.

Not applicable

Thanks, Anil, for a helpful tool! I opened an Enhancement issue in the repo to see if you can get the complex objects moved to a definition section and corresponding reference in the result/response section, per the spec. I think I may work on a PR and put it up for you to review.

anilsr
Staff

Dear @Brian ,

Welcome to Apigee Community 🙂 Thank you very much for your valuable feedback. Agree, Complex objects should be moved into definitions section & reference using $ref. Looking forward to your PR. Keep us posted.

anilsr
Staff

@Diego Zuluaga , Did you get a chance to play with above tool ? Any feedback on same ?

Not applicable

Thanks for checking in @Anil Sagar. We did use the api2swagger for generating specs and iterated throughout the process to build an API lifecycle that embraces DRY (don't repeat yourself). The result has been great, as we've been able to reduce a lot of boilerplate code generated by writing the specs by hand. My team and I are planning on writing a blog post on this to share with the community. Stay tuned. Will keep you posted.

anilsr
Staff

Awesome @Diego Zuluaga , Very glad to hear things your team is working on. Excited to see blog post soon.

Not applicable

Hi @Anil Sagar

I am trying to use this tool for my project.It works great..

But when it comes to HTTP verb as POST,I am not able to pass through below command.

The results are not correct.

I am passing as below.

api2swagger -e "https://in.api.xyz.com/abc" -o "TestSwagger.json" -X POST -d  "{ "application": { "context": { "msg_identifier":
"1", "platform_name": "e" }, "d": { "sequence": "10000001", "method": "", "type": [  ] } } }"

The result I am seeing is,

       "parameters": [
         {
           "in": "body",
           "name": "body",
           "description": "Request Payload Body",
           "required": true,
           "schema": "'{"
         },
         {
           "in": "body",
           "name": "body",
           "description": "Request Payload Body",
           "required": true,
           "schema": "{ "application": { "context": { "msg_identifier":
"1", "platform_name": "e" }, "d": { "sequence": "10000001", "method": "", "type": [  ] } } }"
         },
          {
            "in": "body",
            "name": "body",
            "description": "Request Payload Body",
            "required": true,
           

"schema": "{\ "application\": { \"context\": {\ "msg_identifier\": \"1\",\ "platform_name\": \"e\" },\ "d\": { \"sequence\":\ "10000001\", \"method\": \"\", \"type\": [ ] } } }"

},

The second "in" body block is repeated 2 times.The third "in" body block is repeated 2 times.

I want the request body payload to be expanded as json schema as it is coming out for response.

Also,I am not sure how to pass header and its value.

Please help on this.

anilsr
Staff

@RK4 , Your command above is broken. See double quotes is not terminating properly. Use single quotes.

api2swagger -e "https://in.api.xyz.com/abc" -o "TestSwagger.json" -X POST -d '{ "application": { "context": { "msg_identifier":
"1", "platform_name": "e" }, "d": { "sequence": "10000001", "method": "", "type": [  ] } } }'

Regarding , Headers Use -H option. For more details check above article which explains how to use headers.

Not applicable

Thanks @Anil Sagar for your response.

The issue does not seem to be with double quotes.When I gave single quotes ,the request I got in Apigee trace was '{ . So,this confirms that its not taking the payload.I am executing from my windows machine.

Then I tried to remove extra spaces and tried with \" for the double quotes inside json.

And also added Header parameter as below.

api2swagger -e "https://in.api.xyz.com/abc" -o "TestSwagger.json" -X POST -d '{\"application\":{\"context":\{\"msg_identifier\":"1",\"platform_name\": \"e\" },\"d\": {\"sequence\": \"10000001\",\"method\":\"\",\"type\":[  ] } } }"  -H "Content-Type:application/json"


When the above command isexecuted,below are the questions answered

? A verbose explanation of the operation behavior.  ? API Method Description


? A short summary of what the operation does. ? Short Summary of API Method


? Additional external documentation for this operation. ? http://docs.example.c
om/management/apis/get/entities


? Unique string used to identify the operation. ? uniqueId


? A list of tags for API documentation control.  ? api2swagger
Making an API Call & fetching more details...Please stay tuned..
Api2swagger needs details related to Header : Content-Type


? Name of URL Param ? Content-Type


? Description of URL Param ? Header Param Description


? Date type of query param ? string


Please provide more details regarding request payload..


? Name of URL Param ? body


? Description of URL Param ? Request Payload Body


? API Path has any dynamic parameters ? (Y/n) n
<br>

Now,I am able to see the request payload with full schema.

However along with the schema,two more "in" blocks coming which is not required.

Here is the excerpt of output ..

        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "Request Payload Body",
            "required": true,
            "schema": "{\"application\":{\"context\":{\"msg_identifier\":\"1\",\"platform_name\":\"M\"},\"pay\":{\"number\":\"41\",\"method\": \"\",\"type\":[  ]}}}"
          },
          {
            "in": "body",
            "name": "body",
            "description": "Request Payload Body",
            "required": true,
            "schema": "{\"application\":{\"context\":{\"msg_identifier\":\"14583
21171\",\"platform_name\":\"M\"},\"pay\":{\"number\":\"41\",\"method\": \"\",\"type\":[  ]}}}"
          },
          {
            "in": "header",
            "name": "Content-Type",
            "description": "Header Param Description",
            "required": true,
            "type": "string",
            "enum": [
              "application/json"
            ]
          },
          {
            "in": "body",
            "name": "body",
            "description": "Request Payload Body",
            "required": true,
            "schema": {
              "description": "",
              "type": "object",
              "properties": {
                "application": {
                  "type": "object",
                  "properties": {
                    "context": {
                      "type": "object",
                      "properties": {
                        "msg_identifier": {
                          "type": "string",
                          "minLength": 1
                        },
                        "platform_name": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "msg_identifier",
                        "platform_name"
                      ]
                    },
                    "pay": {
                      "type": "object",
                      "properties": {
                        "number": {
                          "type": "string",
                          "minLength": 1
                        },
                        "method": {
                          "type": "string"
                        },
                        "type": {
                          "type": "array",
                          "items": {
                            "properties": {}
                          }
                        }
                      },
                      "required": [
                        "number",
                        "method",
                        "type"
                      ]
                    }
                  },
                  "required": [
                    "context",
                    "pay"
                  ]
                }
              },
              "required": [
                "application"
              ]
            }
          },
<br>

I need only the third "in": "body" block.The first two "in": "body" blocks are not expected.

As a workaround,I am deleting manually.

I am not sure if I am missing anything.Can you please help?

edu4krishanu
New Member

HI @Anil Sagar,

Is http://specgen.apistudio.io/ available to install in local. We are using apigee on-prem version. We want this tool within our organization so that it can access the internal urls.

Thanks,

Krish

anilsr
Staff

@Krish , use command line tool api2swagger, Specgen UI is built using api2swagger nodejs module. Hope it helps.

edu4krishanu
New Member

Yup. This is an amazing tool. Thank you for building it 🙂

Not applicable

Great post! I tried api2swagger command line, generated json file is overwritten each other instead of appending. Did I do anything wrong? Thanks

anilsr
Staff

@Emily Gu , If hostname & basepath matches, It should append. Let us know more details if you see otherwise.

edu4krishanu
New Member

HI @Anil Sagar- Is http://specgen.apistudio.io/ down? I am getting connection refused since yesterday.

Thanks,

Krish

Version history
Last update:
‎01-08-2016 05:22 AM
Updated by: