heldersepu / Swagger-Net

Seamlessly adds a swagger to WebApi projects!
BSD 3-Clause "New" or "Revised" License
144 stars 42 forks source link

Inject plugin #110

Open splendid25 opened 2 years ago

splendid25 commented 2 years ago

Hi,

I'm trying to add a plugin to swagger-ui, like so : https://github.com/swagger-api/swagger-ui/issues/3876#issuecomment-412476501

I can inject a custom javascript for the plugin, but I can't find a way to inject it to the plugin list in the SwaggerUIBundle method.

const ui = SwaggerUIBundle({
    //...
    plugins: [ SwaggerUIBundle.plugins.DownloadUrl ], //=> how to customise ?
    //...
});

Is it possible ? Thanks

heldersepu commented 2 years ago

Yes that sounds about right... I never tried that myself, this is the file you will need to change: https://github.com/heldersepu/Swagger-Net/blob/6afdb0c1ba611273f27e8a904ec2bb06a630b1b4/Swagger.Net/SwaggerUi/CustomAssets/index.html#L109