custom the page title
| Q | A |
|---|---|
| Bug or feature request? | feature request |
Expected Behavior
when i develop a web site,i will open different Swagger-UI pages,but when all page name with title "Swagger UI",i want to custom the page title..
@rainplus, how are you using Swagger-UI? npm, git clone, something else?
@shockey Thanks for reply! I use spring boot,just dependency the jar of
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
i know all the request except "swagger-ui.html" all is ajax.... At present I use the method is override the page "META-INF/resources/swagger-ui.html",add I want to do,So has any else way to do it ? Or office has a metod to custom the page title? because i really will open too many swagger-api pages.But I can not identify which services they belong to.
Yeah, so that file actually isn't in our codebase, that's Springfox's. See here: https://github.com/springfox/springfox/blob/master/springfox-swagger-ui/src/web/swagger-ui.html#L5
Swagger-UI doesn't offer a way to control the page title (we don't do anything to the title), but you can control the title of any page with a small JavaScript snippet in your HTML, like this:
<script>
document.title = "My New Title!"
</script>
Thanks