Usage:

import routing from '@novice1/routing';
import {
OpenAPI,
BearerUtil
} from '@novice1/api-doc-generator';

/**
* BearerUtil extends BaseAuthUtil extends BaseContextAuthUtil
*/
const bearerAuth = new BearerUtil('bearerName');

const openapi = new OpenAPI();

// add it to the security schemes
openapi.addSecuritySchemes(bearerAuth);

const router = routing()
.get({
path: '/admin',
auth: true,
parameters: {
// add security requirement for this route
security: bearerAuth
}
}, function (req, res) {
res.json({})
});

Hierarchy (view full)

Implements

  • IAuthUtil

Constructors

Properties

description?: string
securitySchemeName: string

Methods

  • Parameters

    • description: string

      A short description for security scheme. CommonMark syntax MAY be used for rich text representation.

    Returns FullAuthUtil