gpt4 book ai didi

java - 为 swagger UI wildfly swarm 指定 swagger.json url

转载 作者:太空宇宙 更新时间:2023-11-04 11:55:42 26 4
gpt4 key购买 nike

我有 Wildfly Swarm 的 REST 应用程序,并使用默认设置,我在 url/swagger 或/swagger.json 上有 swagger.json,在 url/swagger-ui 上有 swagger ui。但默认情况下,UI 从示例中解析 petstore。如何将 UI 的默认路径配置到我的 json 文件?我有 swagger 的下一个依赖项:

<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>swagger</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>swagger-webapp</artifactId>
</dependency>

最佳答案

您可以为 swagger-ui 提供一个链接到 swagger.json 的 url 参数。例如:

http://localhost:8080/swagger-ui/index.html?url=/swagger.json

关于java - 为 swagger UI wildfly swarm 指定 swagger.json url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41415247/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com