scttcper / koa2-swagger-ui

Swagger UI as Koa v2 middleware
MIT License
103 stars 32 forks source link

multiple spec files and urls #224

Open minchevz opened 2 years ago

minchevz commented 2 years ago

Hi, im trying to use with multiple spec files and urls defined. but it runs only one of them if i define 2 spec. is it possible to run like this as in swagger-ui package .

const ui = SwaggerUIBundle({
    urls: [
      { name: 'v1', url: 'https://petstore.swagger.io/v2/swagger.json'},
      { name: 'v2', url: 'https://petstore.swagger.io/v2/swagger.json'}
    ]
  })

using the middleware as its , it runs only on of them currently if i dont miss anything.

 koaSwagger({ 
    routePrefix: false,
    swaggerOptions: { 
        urls: [
          { name: 'v1', url: 'https://petstore.swagger.io/v2/swagger.json'},
          { name: 'v2', url: 'https://petstore.swagger.io/v2/swagger.json'}
        ]
    } 
 })

would be good if its possible to run with multiple endpoints as array and can version apis on UI as :

image