<code>springdoc-openapi-ui</code>

问题描述 投票:0回答:3
Http:// localhost上加载摇动:8080/Swagger-ui.html

代替。

	
我在Github网站上提出了相同的问题。链接在下面提供 https://github.com/springdoc/springdoc-openapi/issues/742#issue-642810354 得到了其中一位贡献者的答复

spring-boot swagger swagger-ui springdoc-openapi-ui
3个回答
7
投票

You use you own version of swagger-ui, so you can add your custom Logic, without having to rely on springdoc-openapi-ui.


这与重定向无关,因为它只能向http:// localhost开放:8080/Swagger-ui/index.html。但是一些答案是关于禁用PetShop和Configurl。供应配置不再适用于自动配置的SpringDoc。覆盖URL,config-url(如果需要),默认URL可与以下应用程序一起使用。

springdoc: swagger-ui: url: "/v3/api-docs" disable-swagger-default-url: true

或您可以使用主题插件:

springdoc: swagger-ui: disable-swagger-default-url: true urls: - url: "/v3/api-docs" name: "myService"
    


4
投票

我在与状态代码404的 /swagger-ui /index.html时有同样的问题。 我的问题是我使用的自定义配置扩展了WebMvcconFigurationSupport:
/swagger-ui/index.html

因此,我必须这样更新该配置,并且可以正常工作! :)
/v3/api-docs

2
投票

我为此找到了解决方案的帖子。扫描并修改索引。
@Configuration class CustomConfig() : WebMvcConfigurationSupport() {...}
    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.