I have defined the swagger.ts as below:
import swaggerJSDoc from "swagger-jsdoc";
import { version } from '../package.json';
const options: swaggerJSDoc.Options = {
definition: {
openapi: "3.0.0",
info: {
title: "abc project",
version
}
},
apis: ["./routes/rootRouter.ts"]
};
export default options;
and i'm trying to document the api is below:
/**
* @openapi
* /isAlive:
* get:
* tags:
* - Healthcheck
* description: Responds if the app is up and running
* responses:
* 200:
* description: App is up and running
*/
router.get('/abc.json', (req, res) => {
res.send({
'name' : 'sdf',
'org' : 'sdf',
'rev': 'local'
});
});
I have done the necessary coding in app.ts. But when the server starts it displays the swagger page but doesn't display the apis documented. Anybody have faced the same issues?