swagger-routes-express
Version:
Connect Express route controllers to restful paths using a Swagger 2 or OpenAPI 3 definition file
15 lines (12 loc) • 363 B
JavaScript
const summarisePaths = require('./summarisePaths')
const basePath = require('../../extract/v3/basePath')
const summariseApi = ({
servers = [],
variables = {},
info: { description, title: name, version },
paths
}) => ({
info: { name, description, version },
paths: summarisePaths(paths, basePath(servers, variables))
})
module.exports = summariseApi