I have defined my swagger definition as shown below:
const swaggerDefinition = {
info: {
title: 'Node Swagger API',
version: '1.0.0',
description: 'Describing a RESTful API with Swagger',
},
host: 'localhost:8000',
basePath: '/',
securityDefinitions: {
JWT: {
type: 'apiKey',
description: 'JWT authorization of an API',
name: 'Authorization',
in: 'header',
},
},
};
But I am unable to get any authorisations in swagger UI and even in swagger.json
info: {
title: "Node Swagger API",
version: "1.0.0",
description: "Describing a RESTful API with Swagger"
},
host: "localhost:8000",
basePath: "/",
securityDefinitions: { },
swagger: "2.0",
The securitydefinitions block is still empty in swagger.json file while I have already added in the swagger definition in server.js
Can anyone suggest how to enable the authorisation or if I am using the pattern incorrectly inside the "securitydefinitions" ?