1.0.5 • Published 3 years ago
custom-swagger-ui-express v1.0.5
Custom Swagger UI Express
Installation
npm i custom-swagger-ui-express -S
Usage
const app = express();
const swaggerUI = require('custom-swagger-ui-express');
swaggerUI.registerSwaggerUI(app, {
route: {
url:'/swagger', // the swagger page link for user to visit
docs:'/swagger.json',// where is the swagger json file
},
layer: 3, // flatten data deepth
filter: {
common: ['_id'], // all columns will not show this list data
route: {}, // for example: {'/xx/xx':['_id']} // appoint filter for route
},
rootElements:{
common:['data.result','data'], // skip data by root elements, in this list they has their own priority, the first is higher after, once find root element, it will not to find the next one
route:{} // appoint root element for route
}
});
You can use Express-swagger-generator to generate json file.
You can use Customer Swagger UI desgin your own swagger UI