Usage:
import routing from '@novice1/routing';import { OpenAPI, Postman, ApiKeyUtil, ApiKeyLocation} from '@novice1/api-doc-generator';const apiKey = new ApiKeyUtil('ApiKeyAuth');apiKey .setName('X-API-KEY') .setApiKeyLocation(ApiKeyLocation.header); // add it to OpenAPI security schemesconst openapi = new OpenAPI();openapi.addSecuritySchemes(apiKey);// add it to Postman global authenticationconst postman = new Postman();postman.setAuth(apiKey);// routerconst router = routing() .get({ path: '/something', auth: true, parameters: { // add security requirements for this route security: apiKey } }, function (req, res) { // do something ... }); Copy
import routing from '@novice1/routing';import { OpenAPI, Postman, ApiKeyUtil, ApiKeyLocation} from '@novice1/api-doc-generator';const apiKey = new ApiKeyUtil('ApiKeyAuth');apiKey .setName('X-API-KEY') .setApiKeyLocation(ApiKeyLocation.header); // add it to OpenAPI security schemesconst openapi = new OpenAPI();openapi.addSecuritySchemes(apiKey);// add it to Postman global authenticationconst postman = new Postman();postman.setAuth(apiKey);// routerconst router = routing() .get({ path: '/something', auth: true, parameters: { // add security requirements for this route security: apiKey } }, function (req, res) { // do something ... });
Protected
Optional
A short description for security scheme. CommonMark syntax MAY be used for rich text representation.
Usage: