Repository: BRIKEV/express-jsdoc-swagger
Pull request #11 (2020-05-31 21:38:04)

More examples
This PR includes the first version of the examples folder.


Patch:
diff --git a/.eslintignore b/.eslintignore
index 4e3751c..3f6ec4f 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -3,3 +3,4 @@ coverage
 test-results.xml
 node_modules
 .github
+examples
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..3127a73
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,31 @@
+# express-jsdoc-swagger examples
+
+This page will includes some examples on how to use this package.
+
+- configuration
+- responses
+- components
+- request body
+- parameters
+- albums API
+
+
+## Run examples
+
+You can run this examples in your machine following these steps.
+
+1. Install dependencies inside examples folder
+
+```
+npm install
+```
+
+2. You can run every example if you execute
+
+```
+npm run <FOLDER>:<FILE_NAME>
+
+npm run responses:simple
+```
+
+Then you can go to the [Docs generated page](http://localhost:3000/api-docs).
diff --git a/examples/basic/package.json b/examples/basic/package.json
deleted file mode 100644
index 7507076..0000000
--- a/examples/basic/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  "name": "basic",
-  "version": "1.0.0",
-  "description": "",
-  "main": "index.js",
-  "scripts": {
-    "start": "node index.js"
-  },
-  "keywords": [],
-  "author": "",
-  "license": "ISC",
-  "dependencies": {
-    "express": "^4.17.1"
-  }
-}
diff --git a/examples/configuration/main.js b/examples/configuration/main.js
new file mode 100644
index 0000000..3eb33f0
--- /dev/null
+++ b/examples/configuration/main.js
@@ -0,0 +1,62 @@
+const express = require('express');
+
+const logger = require('../utils/logger');
+const expressJSDocSwagger = require('../..');
+
+// This is a full set of options
+// It is not neccesary to complete every option
+const options = {
+  info: {
+    version: '1.0.0',
+    title: 'Albums store',
+    license: {
+      name: 'MIT',
+      url: 'http://example.com',
+    },
+    description: 'API desctiption',
+    contact: {
+      name: 'contact name',
+      url: 'http://example.com',
+      email: 'test@test.com',
+    },
+    termsOfService: 'http://example.com',
+  },
+  servers: [
+    {
+      url: 'https://{username}.gigantic-server.com:{port}/{basePath}',
+      description: 'The production API server',
+      variables: {
+        username: {
+          default: 'demo',
+          description: 'this value is assigned by the service provider, in this example `gigantic-server.com`',
+        },
+        port: {
+          enum: [
+            '8443',
+            '443',
+          ],
+          default: '8443',
+        },
+        basePath: {
+          default: 'v2',
+        },
+      },
+    },
+  ],
+  file: './main.js',
+  baseDir: __dirname,
+};
+
+const app = express();
+const port = 3000;
+
+expressJSDocSwagger(app)(options);
+
+/**
+ * GET /api/v1
+ * @summary This is the summary or description of the endpoint
+ * @return {string} 200 - success response
+ */
+app.get('/api/v1', (req, res) => res.send('Hello World!'));
+
+app.listen(port, () => logger.info(`Example app listening at http://localhost:${port}`));
diff --git a/examples/basic/package-lock.json b/examples/package-lock.json
similarity index 58%
rename from examples/basic/package-lock.json
rename to examples/package-lock.json
index 5ba961f..0e27580 100644
--- a/examples/basic/package-lock.json
+++ b/examples/package-lock.json
@@ -1,5 +1,5 @@
 {
-  "name": "basic",
+  "name": "express-jsdoc-swagger-examples",
   "version": "1.0.0",
   "lockfileVersion": 1,
   "requires": true,
@@ -18,6 +18,14 @@
       "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
       "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
     },
+    "async": {
+      "version": "2.6.3",
+      "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
+      "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
+      "requires": {
+        "lodash": "^4.17.14"
+      }
+    },
     "body-parser": {
       "version": "1.19.0",
       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@@ -40,6 +48,56 @@
       "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
       "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
     },
+    "color": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz",
+      "integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==",
+      "requires": {
+        "color-convert": "^1.9.1",
+        "color-string": "^1.5.2"
+      }
+    },
+    "color-convert": {
+      "version": "1.9.3",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+      "requires": {
+        "color-name": "1.1.3"
+      }
+    },
+    "color-name": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+      "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
+    },
+    "color-string": {
+      "version": "1.5.3",
+      "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz",
+      "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==",
+      "requires": {
+        "color-name": "^1.0.0",
+        "simple-swizzle": "^0.2.2"
+      }
+    },
+    "colornames": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz",
+      "integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y="
+    },
+    "colors": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
+      "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
+    },
+    "colorspace": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.2.tgz",
+      "integrity": "sha512-vt+OoIP2d76xLhjwbBaucYlNSpPsrJWPlBTtwCpQKIu6/CSMutyzX93O/Do0qzpH3YoHEes8YEFXyZ797rEhzQ==",
+      "requires": {
+        "color": "3.0.x",
+        "text-hex": "1.0.x"
+      }
+    },
     "content-disposition": {
       "version": "0.5.3",
       "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
@@ -63,6 +121,11 @@
       "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
       "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
     },
+    "core-util-is": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+      "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+    },
     "debug": {
       "version": "2.6.9",
       "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -81,16 +144,39 @@
       "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
       "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
     },
+    "diagnostics": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz",
+      "integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==",
+      "requires": {
+        "colorspace": "1.1.x",
+        "enabled": "1.0.x",
+        "kuler": "1.0.x"
+      }
+    },
     "ee-first": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
       "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
     },
+    "enabled": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz",
+      "integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=",
+      "requires": {
+        "env-variable": "0.0.x"
+      }
+    },
     "encodeurl": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
       "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
     },
+    "env-variable": {
+      "version": "0.0.6",
+      "resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.6.tgz",
+      "integrity": "sha512-bHz59NlBbtS0NhftmR8+ExBEekE7br0e01jw+kk0NDro7TtZzBYZ5ScGPs3OmwnpyfHTHOtr1Y6uedCdrIldtg=="
+    },
     "escape-html": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -138,6 +224,16 @@
         "vary": "~1.1.2"
       }
     },
+    "fast-safe-stringify": {
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
+      "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
+    },
+    "fecha": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz",
+      "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg=="
+    },
     "finalhandler": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
@@ -192,6 +288,53 @@
       "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
       "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
     },
+    "is-arrayish": {
+      "version": "0.3.2",
+      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
+      "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
+    },
+    "is-stream": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
+      "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
+    },
+    "isarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+    },
+    "kuler": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz",
+      "integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==",
+      "requires": {
+        "colornames": "^1.1.1"
+      }
+    },
+    "lodash": {
+      "version": "4.17.15",
+      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+      "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
+    },
+    "logform": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz",
+      "integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==",
+      "requires": {
+        "colors": "^1.2.1",
+        "fast-safe-stringify": "^2.0.4",
+        "fecha": "^2.3.3",
+        "ms": "^2.1.1",
+        "triple-beam": "^1.3.0"
+      },
+      "dependencies": {
+        "ms": {
+          "version": "2.1.2",
+          "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+          "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+        }
+      }
+    },
     "media-typer": {
       "version": "0.3.0",
       "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -243,6 +386,11 @@
         "ee-first": "1.1.1"
       }
     },
+    "one-time": {
+      "version": "0.0.4",
+      "resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz",
+      "integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4="
+    },
     "parseurl": {
       "version": "1.3.3",
       "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -253,6 +401,11 @@
       "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
       "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
     },
+    "process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+    },
     "proxy-addr": {
       "version": "2.0.6",
       "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
@@ -283,6 +436,16 @@
         "unpipe": "1.0.0"
       }
     },
+    "readable-stream": {
+      "version": "3.6.0",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+      "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+      "requires": {
+        "inherits": "^2.0.3",
+        "string_decoder": "^1.1.1",
+        "util-deprecate": "^1.0.1"
+      }
+    },
     "safe-buffer": {
       "version": "5.1.2",
       "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
@@ -336,16 +499,54 @@
       "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
       "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
     },
+    "simple-swizzle": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
+      "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
+      "requires": {
+        "is-arrayish": "^0.3.1"
+      }
+    },
+    "stack-trace": {
+      "version": "0.0.10",
+      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
+      "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
+    },
     "statuses": {
       "version": "1.5.0",
       "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
       "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
     },
+    "string_decoder": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+      "requires": {
+        "safe-buffer": "~5.2.0"
+      },
+      "dependencies": {
+        "safe-buffer": {
+          "version": "5.2.1",
+          "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+          "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
+        }
+      }
+    },
+    "text-hex": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
+      "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
+    },
     "toidentifier": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
       "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
     },
+    "triple-beam": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz",
+      "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw=="
+    },
     "type-is": {
       "version": "1.6.18",
       "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@@ -360,6 +561,11 @@
       "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
       "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
     },
+    "util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+    },
     "utils-merge": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
@@ -369,6 +575,55 @@
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
       "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
+    },
+    "winston": {
+      "version": "3.2.1",
+      "resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz",
+      "integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==",
+      "requires": {
+        "async": "^2.6.1",
+        "diagnostics": "^1.1.1",
+        "is-stream": "^1.1.0",
+        "logform": "^2.1.1",
+        "one-time": "0.0.4",
+        "readable-stream": "^3.1.1",
+        "stack-trace": "0.0.x",
+        "triple-beam": "^1.3.0",
+        "winston-transport": "^4.3.0"
+      }
+    },
+    "winston-transport": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz",
+      "integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==",
+      "requires": {
+        "readable-stream": "^2.3.6",
+        "triple-beam": "^1.2.0"
+      },
+      "dependencies": {
+        "readable-stream": {
+          "version": "2.3.7",
+          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+          "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        }
+      }
     }
   }
 }
diff --git a/examples/package.json b/examples/package.json
new file mode 100644
index 0000000..1f7e8cb
--- /dev/null
+++ b/examples/package.json
@@ -0,0 +1,20 @@
+{
+  "name": "express-jsdoc-swagger-examples",
+  "version": "1.0.0",
+  "description": "A set of examples of the package",
+  "main": "index.js",
+  "scripts": {
+    "configuration:main": "node configuration/main.js",
+    "responses:simple": "node responses/simple.js",
+    "responses:multiple": "node responses/multiple.js",
+    "responses:components": "node responses/components.js",
+    "responses:full-example": "node responses/full-example.js"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "express": "^4.17.1",
+    "winston": "^3.2.1"
+  }
+}
diff --git a/examples/responses/components.js b/examples/responses/components.js
new file mode 100644
index 0000000..fab6c0a
--- /dev/null
+++ b/examples/responses/components.js
@@ -0,0 +1,42 @@
+const express = require('express');
+
+const logger = require('../utils/logger');
+const expressJSDocSwagger = require('../..');
+
+const options = {
+  info: {
+    version: '1.0.0',
+    title: 'Albums store',
+    license: {
+      name: 'MIT',
+    },
+  },
+  file: './components.js',
+  baseDir: __dirname,
+};
+
+const app = express();
+const port = 3000;
+
+expressJSDocSwagger(app)(options);
+
+/**
+ * A song type
+ * @typedef {object} Song
+ * @property {string} title.required - The title
+ * @property {string} artist - The artist
+ * @property {number} year - The year - int64
+ */
+
+/**
+ * GET /api/v1/albums
+ * @summary This is the summary or description of the endpoint
+ * @return {array<Song>} 200 - success response - application/json
+ */
+app.get('/api/v1/albums', (req, res) => (
+  res.json([{
+    title: 'abum 1',
+  }])
+));
+
+app.listen(port, () => logger.info(`Example app listening at http://localhost:${port}`));
diff --git a/examples/responses/full-example.js b/examples/responses/full-example.js
new file mode 100644
index 0000000..114504d
--- /dev/null
+++ b/examples/responses/full-example.js
@@ -0,0 +1,70 @@
+const express = require('express');
+
+const logger = require('../utils/logger');
+const expressJSDocSwagger = require('../..');
+
+const options = {
+  info: {
+    version: '1.0.0',
+    title: 'Albums store',
+    license: {
+      name: 'MIT',
+    },
+  },
+  file: './full-example.js',
+  baseDir: __dirname,
+};
+
+const app = express();
+const port = 3000;
+
+expressJSDocSwagger(app)(options);
+
+/**
+ * A song type
+ * @typedef {object} Song
+ * @property {string} title.required - The title
+ * @property {string} artist - The artist
+ * @property {number} year - The year - int64
+ */
+
+/**
+ * GET /api/v2/album
+ * @summary This is the summary or description of the endpoint
+ * @tags album
+ * @return {object} 200 - success response - application/json
+ * @return {object} 400 - Bad request response
+ */
+app.get('/api/v2/album', (req, res) => (
+  res.json({
+    title: 'abum 1',
+  })
+));
+
+/**
+ * GET /api/v1/album
+ * @summary This is the summary or description of the endpoint
+ * @tags album
+ * @deprecated
+ * @return {object} 200 - success response - application/json
+ * @return {object} 400 - Bad request response
+ */
+app.get('/api/v1/album', (req, res) => (
+  res.json({
+    title: 'abum 1',
+  })
+));
+
+/**
+ * GET /api/v1/albums
+ * @summary This is the summary or description of the endpoint
+ * @tags album
+ * @return {array<Song>} 200 - success response - application/json
+ */
+app.get('/api/v1/albums', (req, res) => (
+  res.json([{
+    title: 'abum 1',
+  }])
+));
+
+app.listen(port, () => logger.info(`Example app listening at http://localhost:${port}`));
diff --git a/examples/basic/index.js b/examples/responses/multiple.js
similarity index 54%
rename from examples/basic/index.js
rename to examples/responses/multiple.js
index cd583a8..7022d7c 100644
--- a/examples/basic/index.js
+++ b/examples/responses/multiple.js
@@ -1,31 +1,35 @@
 const express = require('express');
 
+const logger = require('../utils/logger');
 const expressJSDocSwagger = require('../..');
 
 const options = {
   info: {
     version: '1.0.0',
-    title: 'Swagger Petstore',
+    title: 'Albums store',
     license: {
       name: 'MIT',
     },
   },
-  file: './**/**.js',
+  file: './multiple.js',
   baseDir: __dirname,
 };
 
 const app = express();
 const port = 3000;
 
-const generator = expressJSDocSwagger(app);
-
-generator(options);
+expressJSDocSwagger(app)(options);
 
 /**
- * GET /api/v1
+ * GET /api/v1/album
  * @summary This is the summary or description of the endpoint
  * @return {object} 200 - success response - application/json
+ * @return {object} 400 - Bad request response
  */
-app.get('/', (req, res) => res.send('Hello World!'));
+app.get('/api/v1/album', (req, res) => (
+  res.json({
+    title: 'abum 1',
+  })
+));
 
-app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`));
+app.listen(port, () => logger.info(`Example app listening at http://localhost:${port}`));
diff --git a/examples/responses/simple.js b/examples/responses/simple.js
new file mode 100644
index 0000000..8e24a3b
--- /dev/null
+++ b/examples/responses/simple.js
@@ -0,0 +1,42 @@
+const express = require('express');
+
+const logger = require('../utils/logger');
+const expressJSDocSwagger = require('../..');
+
+const options = {
+  info: {
+    version: '1.0.0',
+    title: 'Albums store',
+    license: {
+      name: 'MIT',
+    },
+  },
+  file: './simple.js',
+  baseDir: __dirname,
+};
+
+const app = express();
+const port = 3000;
+
+expressJSDocSwagger(app)(options);
+
+/**
+ * GET /api/v1
+ * @summary This is the summary or description of the endpoint
+ * @return {string} 200 - success response
+ */
+app.get('/api/v1', (req, res) => res.send('Hello World!'));
+
+/**
+ * GET /api/v1/albums
+ * @summary This is the summary or description of the endpoint
+ * @return {object} 200 - success response - application/json
+ * @return {array<object>} 200 - success response - application/json
+ */
+app.get('/api/v1/albums', (req, res) => (
+  res.json([{
+    title: 'abum 1',
+  }])
+));
+
+app.listen(port, () => logger.info(`Example app listening at http://localhost:${port}`));
diff --git a/examples/utils/logger.js b/examples/utils/logger.js
new file mode 100644
index 0000000..e566ea2
--- /dev/null
+++ b/examples/utils/logger.js
@@ -0,0 +1,9 @@
+const winston = require('winston');
+
+const logger = winston.createLogger({
+  transports: [
+    new winston.transports.Console(),
+  ],
+});
+
+module.exports = logger;
diff --git a/index.js b/index.js
index 6385d43..cd87ec0 100644
--- a/index.js
+++ b/index.js
@@ -33,6 +33,7 @@ const expressJSDocSwagger = app => {
     let swaggerObject = {
       openapi: '3.0.0',
       info: options.info,
+      servers: options.servers,
     };
 
     debug('Getting basic swagger info');
diff --git a/transforms/basic/servers.js b/transforms/basic/servers.js
index f369093..5235107 100644
--- a/transforms/basic/servers.js
+++ b/transforms/basic/servers.js
@@ -1,20 +1,5 @@
 const setProperty = require('../utils/setProperty')('servers');
 
-const setVariables = variables => ({
-  enum: setProperty(variables, 'enum', {
-    type: 'array',
-    required: true,
-  }),
-  default: setProperty(variables, 'default', {
-    type: 'string',
-    required: true,
-  }),
-  description: setProperty(variables, 'description', {
-    type: 'string',
-    defaultValue: '',
-  }),
-});
-
 const setServer = (server = {}) => ({
   url: setProperty(server, 'url', {
     type: 'string',
@@ -24,7 +9,7 @@ const setServer = (server = {}) => ({
     type: 'string',
     defaultValue: '',
   }),
-  variables: server.variables ? server.variables.map(setVariables) : [],
+  variables: server.variables ? server.variables : {},
 });
 
 const setServers = (servers = []) => {
diff --git a/transforms/components/index.js b/transforms/components/index.js
index 48c921b..1ffc7cf 100644
--- a/transforms/components/index.js
+++ b/transforms/components/index.js
@@ -33,6 +33,7 @@ const isPropertyRequired = properties => {
 const parseSchema = schema => {
   const typedef = getTagInfo(schema.tags, 'typedef');
   const propertyValues = getTagsInfo(schema.tags, 'property');
+  if (!typedef || !typedef.name) return {};
   return {
     [typedef.name]: {
       description: schema.description,
diff --git a/transforms/paths/responses.js b/transforms/paths/responses.js
index a6acea3..ca927b2 100644
--- a/transforms/paths/responses.js
+++ b/transforms/paths/responses.js
@@ -9,6 +9,7 @@ const responsesGenerator = (returnValues = []) => {
   const response = returnValues.reduce((acc, value) => {
     const [status, responseDescription, contentType] = mapDescription(value.description);
     if (!STATUS_CODES[Number(status)]) {
+      // eslint-disable-next-line
       console.warn(chalk.yellow(`Status ${status} is not valid to create a response`));
       return {};
     }
diff --git a/transforms/tags/index.js b/transforms/tags/index.js
index 087a512..97cc017 100644
--- a/transforms/tags/index.js
+++ b/transforms/tags/index.js
@@ -1,14 +1,18 @@
+const { getTagsInfo } = require('../utils/tags');
 const { flatArray, getIndexBy } = require('../utils/arrays');
 
 const FILTER_TAG_KEY = 'name';
 
-const formatTags = ({ tags = [] }) => tags.map(tag => {
-  const [name, description] = tag.description.split(' - ');
-  return {
-    name,
-    description,
-  };
-});
+const formatTags = ({ tags = [] }) => {
+  const infoTags = getTagsInfo(tags, 'tags');
+  return infoTags.map(tag => {
+    const [name, description] = tag.description.split(' - ');
+    return {
+      name,
+      description,
+    };
+  });
+};
 
 const filterDuplicateTags = tags => (
   tags.filter(({ name }, i) => getIndexBy(tags, FILTER_TAG_KEY, name) === i)
diff --git a/transforms/utils/setProperty.js b/transforms/utils/setProperty.js
index 1811a3f..7a65fe8 100644
--- a/transforms/utils/setProperty.js
+++ b/transforms/utils/setProperty.js
@@ -3,6 +3,7 @@ const chalk = require('chalk');
 const setProperty = entity => {
   const requiredError = (key, item) => new Error(`Key ${key} is required in item ${JSON.stringify(item)} for Entity ${entity}`);
 
+  // eslint-disable-next-line
   const warnType = (type, value) => console.warn(chalk.yellow(`${type} is not valid with value ${value} for Entity ${entity}`));
 
   return (item, key, options) => {


Test patch:
diff --git a/test/transforms/basic/index.test.js b/test/transforms/basic/index.test.js
index 35db6aa..25bfb6d 100644
--- a/test/transforms/basic/index.test.js
+++ b/test/transforms/basic/index.test.js
@@ -85,22 +85,6 @@ describe('basic transform method', () => {
     }).toThrow('Key url is required in item {"invalid":"example"} for Entity servers');
   });
 
-  it('should throw error for invalid variable', () => {
-    const input = {
-      info: {
-        title: 'API 1',
-        version: '1.0.0',
-      },
-      servers: [{
-        url: 'http://url.com',
-        variables: [{ invalid: 'example' }],
-      }],
-    };
-    expect(() => {
-      getBasicInfo(input);
-    }).toThrow('Key enum is required in item {"invalid":"example"} for Entity servers');
-  });
-
   it('should return valid configuration', () => {
     const input = {
       info: {
@@ -109,10 +93,10 @@ describe('basic transform method', () => {
       },
       servers: [{
         url: 'http://url.com',
-        variables: [{
+        variables: {
           enum: ['300', '200'],
           default: 200,
-        }],
+        },
       }],
     };
     const expected = {
@@ -128,11 +112,10 @@ describe('basic transform method', () => {
         {
           url: 'http://url.com',
           description: '',
-          variables: [{
+          variables: {
             enum: ['300', '200'],
             default: 200,
-            description: '',
-          }],
+          },
         },
       ],
     };
diff --git a/test/transforms/components/index.test.js b/test/transforms/components/index.test.js
index 5afbb7d..7e0b2f1 100644
--- a/test/transforms/components/index.test.js
+++ b/test/transforms/components/index.test.js
@@ -26,6 +26,25 @@ describe('parseComponents method', () => {
     expect(result).toEqual(expected);
   });
 
+  it('Should parse jsdoc and return default value when there is no typedef', () => {
+    const jsodInput = [`
+      /**
+       * A song
+       * @property {string} title - The title
+       * @property {string} artist - The artist
+       * @property {number} year - The year
+       */
+    `];
+    const expected = {
+      components: {
+        schemas: {},
+      },
+    };
+    const parsedJSDocs = jsdocInfo()(jsodInput);
+    const result = parseComponents({}, parsedJSDocs);
+    expect(result).toEqual(expected);
+  });
+
   it('Should parse jsdoc component spec with basic properties', () => {
     const jsodInput = [`
       /**
diff --git a/test/transforms/tags/index.test.js b/test/transforms/tags/index.test.js
index 5f5a2dc..5d8f48d 100644
--- a/test/transforms/tags/index.test.js
+++ b/test/transforms/tags/index.test.js
@@ -12,6 +12,21 @@ describe('parseTags method', () => {
     expect(result).toEqual(expected);
   });
 
+  it('Should not parse params that aren\'t tags', () => {
+    const jsodInput = [`
+      /**
+       * GET /api/v1/album
+       * @summary example of no summary
+       */
+    `];
+    const expected = {
+      tags: [],
+    };
+    const parsedJSDocs = jsdocInfo()(jsodInput);
+    const result = parseTags({}, parsedJSDocs);
+    expect(result).toEqual(expected);
+  });
+
   it('should return empty tags array with not an array as parameter', () => {
     const initialState = {};
     const tags = 2;