Pankod

Pankod

  • Docs
  • Github

›Features

Introduction

  • Getting Started
  • What's included?

Overview

  • Setup
  • Example App
  • Structure
  • Deployment

Features

  • Testing
  • Swagger
  • ESLint
  • TypeORM

Project CLI

  • Overview
  • Usage
  • Migration Guide

Usage

swagger-jsdoc is a library which returns the validated OpenAPI specification as JSON or YAML.

moleculerjs-boilerplate uses swagger-jsdoc for generating swagger.json file.

This code block shows swagger-jsdoc in services/attack.service of example app.

    /**
    * @swagger
    *
    *  attack/Fire:
    *    post:
    *      description: Attacks to the planet with given weapon.
    *      produces:
    *        - application/json
    *      consumes:
    *        - application/json
    *      parameters:
    *        - in: body
    *          name: params
    *          schema:
    *            type: object
    *            required:
    *              - weaponName
    *              - planetName
    *            properties:
    *              weaponName:
    *                type: string
    *                default: Death Star
    *              planetName:
    *                type: string
    *      responses:
    *        200:
    *          description: Example attack result
    *        422:
    *          description: Missing parameters
    */


After running the service you will see the example API documentation on localhost:3001 which is shown at the below.



Refer to offical documentation for detailed usage.

← TestingESLint →
Pankod
Docs
Getting StartedExample AppFeaturesSetup
Community
Twitter
More
GitHubStar
Pankod Open Source
Copyright © 2019 pankod