📔
Labs API Starter
  • Basic Node API
  • Contributing to this scaffold project
  • examples
    • Example Models
    • Example routes of resources
    • Swagger Setup
  • Testing
Powered by GitBook
On this page
  • Swagger UI Express
  • Swagger JS Doc

Was this helpful?

  1. examples

Swagger Setup

PreviousExample routes of resourcesNextTesting

Last updated 3 years ago

Was this helpful?

Swagger docs are created using . There are 2 libraries used to generate the swagger formatted docs:

Quick review of the swagger setup in Labs projects.

Swagger UI Express

This library is used to setup and serve the offical swager ui resources (html,css,js). The express app is setup to send requests to the route /api-docs to the swagger-ui-express library.

Swagger JS Doc

This library is used to parse the root definition file and inline JsDoc comments. The api documentation entries are found inline on the router files in api/**/*Router.js and use the yaml notation format. This is the most common format found in swagger reference docs and resources found online.

The jsdoc.js definition file contains the application level information, like app name, version, description and license. You can define reusable components in this file and reference them throughout your jsdoc comments.

Take note in the jsdoc.js file that tags are used to group routes together.

open api v3 notations
swagger-ui-express
swagger-jsdoc