Swagger API Docs Squeezer Plugin . This plugin enables Swagger API Docs support within the Squeezer Framework.
cd PROJECT_DIR
npm i squeezer-swagger --save
PROJECT_DIR/squeezer.yml
plugins:
- name: squeezer-swagger
path: node_modules
.
PROJECT_DIR
└─squeezer.yml
squeezer.yml
:
swagger:
info:
title: My API Docs
description: detailed docs for my API endpoints
definitions:
ErrorResponse:
type: object
properties:
message:
type: string
default: error message
code:
type: string
default: error code
statusCode:
type: integer
default: 400
You can add paths and definitions for a specific function on your project.
PROJECT_DIR
└─services/
└── hello
└──function1
├── handler.js
└── sqzueezer.yml
squeezer.yml
:
swagger:
paths:
/pet:
post:
tags:
- "pet"
summary: "Add a new pet to the store"
description: "long description"
operationId: "addPet"
consumes:
- "application/json"
- "application/xml"
produces:
- "application/xml"
- "application/json"
definitions:
Pet:
type: "object"
required:
- "name"
- "photoUrls"
properties:
id:
type: "integer"
format: "int64"