Using Swagger in conjunction with typescript, swagger-jsdocs, and swagger-ui-express has been a smooth process during local development. However, upon deployment, the specifications fail to display.
const options = {
definition: {
openapi: "3.1.0",
info: {
title: "SFMB Documentation",
version: "0.1.0",
description:
"SFMB API Documentation",
},
components: {
securitySchemes: {
bearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
}
}
},
security: [{
bearerAuth: []
}],
servers: [
{
url: "http://localhost:8080",
description: "Local Server for version 1"
},
],
},
apis: ["**/*.ts"]
};
const swaggerSpecs = swaggerJsdoc(options);
This represents the swagger specifications file
The actual swagger code exists within files
/**
* @swagger
* /api/v1/location/locationParent:
* put:
* tags:
* - Location
* summary: Update location Parent
* description: Update location Parent
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.0",
These versions are currently in use.
This route is created to showcase the documentation
app.use('/docs', swagger.serve, swagger.setup(swaggerSpecs));
Could the issue be related to comments being ignored when transpiling typescript code?