{"_id":"@aquilacms/express-jsdoc-swagger","_rev":"1-0f37718d1e3288d217150666b9032576","name":"@aquilacms/express-jsdoc-swagger","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.6":{"name":"@aquilacms/express-jsdoc-swagger","version":"1.0.6","description":"Swagger OpenAPI 3.x generator","main":"index.js","directories":{"example":"examples","test":"test"},"dependencies":{"chalk":"^4.1.0","doctrine":"^3.0.0","express":"^4.17.1","glob":"^7.1.6","merge":"^1.2.1","swagger-ui-express":"^4.1.4"},"devDependencies":{"@commitlint/cli":"^9.1.2","@commitlint/config-conventional":"^10.0.0","eslint":"^7.2.0","eslint-config-airbnb":"^18.2.1","eslint-config-airbnb-base":"^14.1.0","eslint-config-prettier":"^6.15.0","eslint-plugin-import":"^2.22.1","eslint-plugin-jest":"^23.13.1","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-prettier":"^3.2.0","eslint-plugin-react":"^7.21.5","eslint-plugin-react-hooks":"^4.0.0","husky":"^4.2.5","jest":"^26.0.1","prettier":"^2.2.1"},"engines":{"node":">= 10.0.0"},"scripts":{"test":"jest","lint":"eslint .","lint:fix":"eslint . --fix"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run lint","pre-push":"npm run test"}},"repository":{"type":"git","url":"git+https://github.com/haegemonia76/express-jsdoc-swagger.git"},"keywords":["swagger","swagger-generator","express","jsdoc","node","docs","documentation","swagger-ui","OpenAPI"],"author":{"name":"Haegemonia76","url":"https://github.com/haegemonia76"},"license":"MIT","bugs":{"url":"https://github.com/haegemonia76/express-jsdoc-swagger/issues"},"homepage":"https://github.com/haegemonia76/express-jsdoc-swagger#readme","gitHead":"ca4e0b8b0264e702a690734c0baacb2ef0c79a30","_id":"@aquilacms/express-jsdoc-swagger@1.0.6","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-iw0cMEnkr9K0f9r2TZ0+1BNzaVRFcjS90/IO9VFks1SOJBbKTSZ6nCExuzPiczJyyPaMwlOcpKDRAwKW/Pg4aA==","shasum":"7eba7123171df3b8aa130ba83ca3a7b91df525d7","tarball":"https://registry.npmjs.org/@aquilacms/express-jsdoc-swagger/-/express-jsdoc-swagger-1.0.6.tgz","fileCount":107,"unpackedSize":217797,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfyPFTCRA9TVsSAnZWagAAM/MP/jXgDe72jYlEQT/W0oNE\nKjL+a9IHXEGqU1AgBx3UpdPneM5HNZdF26WkRdxwyzkj00/EUrtcrDt1FXwK\n2x3x7jNW+riglrtYujVfL1v9I295/oJCIv0Jsges56Exl+SFcUJHCW2HI/VL\nbxosNc3UAyg/2DADo3A3tHqbQrXavdD/0PnPtgqNtwU1FME1t+cLiB0qpkpo\niSJl7c85/4FS8YACjdpCKzkQVqRuf++qnbPd5WNroQgPrmPVPMZXotgPUtpm\nKIOtBn/keqUkKKldEEwsQo+EkMQiYYizN39n1eVQ03kJRmZJzxXXbIqkv8PH\n06SDxxQ3Zo92PZiTERzpBznCnokHgTNfQPH33IWUXEZQw33Rmnn3JJIZ4enW\nNTn76m0HO9FQm06Wl9v4g8UyB9tOP9jNjqd5Sd7//Tx2b1MkNwr2KqCZHoKB\nBeiDaNGpF6i/S6HY3xVqbmbQwTMUDWNdBg9MuD5ApPnekStbezpWdz0FUIYk\nBN6oGhTodVrvUkAidscyl1PjELBrrJ8MasJKU8KXvhKBq0b79FyBoTb3CAQA\nN9oLtTAbqzjObn+n3nnZmI8gJMXG/67uOwNdAVC1m7CPP8/VnaLUdGzU9mB7\nID0KgwKud8g0Vz8mye49TkbCxa8k0zNJ7WaQKvetqj/MAeHvEIWzL3x/RUAm\nPGp1\r\n=eJIw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBYAjTClavgwL5xq8/g/VsEmt0/kCLzjWqiOaVZRucD/AiAFY8oqHNfucwtazzDW+V6i+el486QCqcXmrFovxPfeDg=="}]},"_npmUser":{"name":"nextsourcia","email":"contact@nextsourcia.com"},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-jsdoc-swagger_1.0.6_1607004498998_0.9758324699669387"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-03T14:08:18.736Z","1.0.6":"2020-12-03T14:08:19.201Z","modified":"2022-04-04T15:14:07.464Z"},"maintainers":[{"name":"nextsourcia","email":"contact@nextsourcia.com"}],"description":"Swagger OpenAPI 3.x generator","homepage":"https://github.com/haegemonia76/express-jsdoc-swagger#readme","keywords":["swagger","swagger-generator","express","jsdoc","node","docs","documentation","swagger-ui","OpenAPI"],"repository":{"type":"git","url":"git+https://github.com/haegemonia76/express-jsdoc-swagger.git"},"author":{"name":"Haegemonia76","url":"https://github.com/haegemonia76"},"bugs":{"url":"https://github.com/haegemonia76/express-jsdoc-swagger/issues"},"license":"MIT","readme":"![npm](https://img.shields.io/npm/v/express-jsdoc-swagger)\n![Node.js Package](https://github.com/BRIKEV/express-jsdoc-swagger/workflows/Build/badge.svg)\n[![Known Vulnerabilities](https://snyk.io/test/github/BRIKEV/express-jsdoc-swagger/badge.svg)](https://snyk.io/test/github/BRIKEV/express-jsdoc-swagger)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6d5565df0c9c10e75b59/maintainability)](https://codeclimate.com/github/BRIKEV/express-jsdoc-swagger/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/6d5565df0c9c10e75b59/test_coverage)](https://codeclimate.com/github/BRIKEV/express-jsdoc-swagger/test_coverage)\n![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)\n![npm](https://img.shields.io/npm/dm/express-jsdoc-swagger)\n\n# express-jsdoc-swagger\n\nWith this library, you can document your express endpoints using swagger [OpenAPI 3 Specification](https://swagger.io/specification/) without writing YAML or JSON. You can write jsdoc comments on each endpoint, and the library is going to create the swagger UI.\n\n## Prerequisites\nThis library assumes you are using:\n1. [NodeJS](https://nodejs.org)\n2. [Express.js](http://www.expressjs.com)\n\n## Installation\n```\nnpm i express-jsdoc-swagger\n```\n\n## Usage\n```javascript\nconst express = require('express');\nconst expressJSDocSwagger = require('express-jsdoc-swagger');\n\nconst options = {\n  info: {\n    version: '1.0.0',\n    title: 'Albums store',\n    license: {\n      name: 'MIT',\n    },\n  },\n  security: {\n    BasicAuth: {\n      type: 'http',\n      scheme: 'basic',\n    },\n  },\n  filesPattern: ['./**/*.js'], // Glob pattern to find your jsdoc files\n  swaggerUIPath: '/your-url', // SwaggerUI will be render in this url. Default: '/api-docs'\n  baseDir: __dirname,\n};\n\nconst app = express();\nconst PORT = 3000;\n\nexpressJSDocSwagger(app)(options);\n\n/**\n * GET /api/v1\n * @summary This is the summary or description of the endpoint\n * @return {object} 200 - success response\n */\napp.get('/api/v1', (req, res) => res.json({\n  success: true,\n}));\n\napp.listen(PORT, () => console.log(`Example app listening at http://localhost:${PORT}`));\n\n```\n\n## Examples\n1. Basic configuration\n```javascript\nconst options = {\n  info: {\n    version: '1.0.0',\n    title: 'Albums store',\n    license: {\n      name: 'MIT',\n    },\n  },\n  security: {\n    BasicAuth: {\n      type: 'http',\n      scheme: 'basic',\n    },\n  },\n  filesPattern: ['./**/*.js'], // Glob pattern to find your jsdoc files\n  baseDir: __dirname,\n};\n```\n\n2. Components definition\n```javascript\n/**\n * A song type\n * @typedef {object} Song\n * @property {string} title.required - The title\n * @property {string} artist - The artist\n * @property {number} year - The year - double\n */\n```\n\n3. Endpoint that returns a `Songs` model array\n```javascript\n/**\n * GET /api/v1/albums\n * @summary This is the summary or description of the endpoint\n * @tags album\n * @return {array<Song>} 200 - success response - application/json\n */\napp.get('/api/v1/albums', (req, res) => (\n  res.json([{\n    title: 'abum 1',\n  }])\n));\n```\n\n4. Basic endpoint definition with tags, params and basic authentication\n```javascript\n/**\n * GET /api/v1/album\n * @summary This is the summary or description of the endpoint\n * @security BasicAuth\n * @tags album\n * @param {string} name.query.required - name param description\n * @return {object} 200 - success response - application/json\n * @return {object} 400 - Bad request response\n */\napp.get('/api/v1/album', (req, res) => (\n  res.json({\n    title: 'abum 1',\n  })\n));\n```\n\nYou can find more examples [here](https://github.com/BRIKEV/express-jsdoc-swagger/tree/master/examples), or visit our [documentation](https://brikev.github.io/express-jsdoc-swagger-docs/#/).\n\n## Contributors ✨\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/bri06\"><img src=\"https://avatars0.githubusercontent.com/u/24435223?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Briam Martinez Escobar</b></sub></a><br /><a href=\"https://github.com/BRIKEV/express-jsdoc-swagger/commits?author=bri06\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://twitter.com/kjmesc\"><img src=\"https://avatars2.githubusercontent.com/u/12685053?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Kevin Julián Martínez Escobar</b></sub></a><br /><a href=\"https://github.com/BRIKEV/express-jsdoc-swagger/commits?author=kevinccbsg\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/hoonga\"><img src=\"https://avatars3.githubusercontent.com/u/10708927?v=4\" width=\"100px;\" alt=\"\"/><br /><sub><b>Heung-yeon Oh</b></sub></a><br /><a href=\"https://github.com/BRIKEV/express-jsdoc-swagger/commits?author=hoonga\" title=\"Code\">💻</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-enable -->\n<!-- prettier-ignore-end -->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","readmeFilename":"README.md"}