This commit is contained in:
2024-11-30 13:25:01 +07:00
parent 3e32e5869e
commit ff45f97a11
6 changed files with 477 additions and 191 deletions

View File

@ -1,4 +1,4 @@
const swaggerAutogen = require('swagger-autogen')();
const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' });
const config = require('config');
const doc = {
@ -7,7 +7,27 @@ const doc = {
description: config.get('app.description'),
version: config.get('app.version')
},
host: config.get('server.host_swagger') + ':' + config.get('server.port'),
servers: [
{
url: config.get('server.host_swagger'),
description: 'Environtment ' + config.get('app.env')
},
],
components: {
schemas: {
product: {
$code: "123456",
$name: "Product name",
$description: "Product description",
$status: "Y",
},
branch: {
$code: "123456",
$name: "Branch name",
$status: "Y",
},
},
}
};
const outputFile = './swagger.json';