Allow InjectJavascript and InjectStylesheet on the UseSwaggerForOcelotUI method #298
pvanhooren
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Hi @pvanhooren, try to use overload method with app.UseSwaggerForOcelotUI(opt =>
{
// configure OcelotSwaggerUIOptions
}, setup =>
{
// configure SwaggerUIOptions
// 👇 this is place for you
setup.InjectJavascript("/swagger-ui/custom.js");
setup.InjectStylesheet("/swagger-ui/custom.css");
}).UseOcelot().Wait(); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently in the process of writing a second API application in our microservices codebase and I stumbled upon this package when researching how to combine two Swagger documentation pages.
I have set everything up to create the combined Swagger page with version selector and all, but now I can't find the option to inject
my own stylesheet and JavaScript file to customize the documentation. Our current Swagger page does have custom CSS and JavaScript, so I'd rather have it on our new combined one as well.
Now I cannot find the extension method in UseSwaggerForOcelotUI , which I assumed to be the substitution of UseSwaggerUI, which does support these extension methods. Therefore I assume this feature is not (yet) supported. I'd also love to hear if that's wrong and if there's a workaround. But if not, I'd like to suggest the idea of adding this here as it would be very helpful for my case and probably many others :)
Here's what I expect to be able to do:
or something along those lines. Again, I'm open for workarounds too, please join the discussion if you have anything to say on this topic!
Beta Was this translation helpful? Give feedback.
All reactions