Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't load Swagger UI plugins through my NSwag configuration. #4921

Open
jarleli opened this issue Jun 24, 2024 · 1 comment
Open

I can't load Swagger UI plugins through my NSwag configuration. #4921

jarleli opened this issue Jun 24, 2024 · 1 comment

Comments

@jarleli
Copy link

jarleli commented Jun 24, 2024

I wanted my NSwag swagger to use a plugin for hierarchical tags to properly visualize several levels in the API structure and domain and found the perfect Swagger Plugin for the job, but I can't add plugins to swagger without manipulating the swagger HTML.

Shoutout to the plugin here: https://www.npmjs.com/package/swagger-ui-plugin-hierarchical-tags

I can provide a PR to allow you to set plugins through:

app.UseSwaggerUi(setting =>
{
    setting.AdditionalPlugins.Add("PluginName", "path/toPluginScript.js");
}); 

It wasn't possible to do this through additionalSettings because the script has to load before the plugins:[].

I feel having general support for swagger plugins through NSwag must be of general interest and figured I'd hear if that's true.

@jarleli
Copy link
Author

jarleli commented Jun 25, 2024

I tested this in my own project, but is there any additional tests or qa I can provide to increase the chances of this being merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant