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
Feat: Accept multiple Javascript and CSS imports #320
For integrating a Swagger plugin I need to be able to include external Javascript.
This works for exactly one because the SwaggerCustomOptions accept 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".
The constraint to only being able to import one external script, one external css and one inline script can be removed by accepting strings and arrays for the customJs, customJsStr and customCssUrl parameter and mapping them to the correct HTML tags.
For integrating a Swagger plugin I need to be able to include external Javascript. This works for exactly one because the SwaggerCustomOptions accept 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".
The constraint to only being able to import one external script, one external css and one inline script can be removed by accepting strings and arrays for the customJs, customJsStr and customCssUrl parameter and mapping them to the correct HTML tags.
I changed that in PR #319