Usage:

import routing from '@novice1/routing';
import {
ContextResponseUtil,
ResponseUtil
} from '@novice1/api-doc-generator';

const notFound = new ResponseUtil('NotFound');
notFound
.setDescription('Entity not found.');

// router
const router = routing()
.get({
path: '/something',
auth: true,
parameters: {
/**
* ContextResponseUtil extends BaseResponseUtil
*/
responses: (new ContextResponseUtil(notFound))
.setCode(404)
}
}, function (req, res) {
// do something ...
});

Hierarchy (view full)

Constructors

Properties

code?: number
default?: boolean
links?: Record<string, ReferenceObject | LinkObject>
ref?: string
responseUtil: BaseResponseUtil

Methods