scottie1984 / swagger-ui-express

Adds middleware to your express app to serve the Swagger UI bound to your Swagger document. This acts as living documentation for your API hosted from within your app.
MIT License
1.41k stars 225 forks source link

Accept multiple Javascript and CSS imports #319

Closed ghost closed 1 year ago

ghost commented 1 year ago

For integrating a Swagger plugin I need to be able to include external Javascript. This works for exactly one because the opts parameter accepts exactly one URL for external Javascript via the customJs property. If I want to use a second Swagger plugin or want to include other Javascript code there is no direct way without "hacking".

This PR removes the constraint to only being able to import one external script, one external css and one inline script by accepting strings and arrays for the customJs, customJsStr and customCssUrl parameter.