Package Exports
- custom-swagger-ui-express
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (custom-swagger-ui-express) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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