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

当springdoc配置使用use-management-port: true的时候找不到/v3/api-docs/swagger-config #803

Open
zhangzhenhuajack opened this issue Jun 6, 2024 · 0 comments

Comments

@zhangzhenhuajack
Copy link

有些场景下面不希望swagger-ui的端口和正常服务的端口保持一致,期望用到spring actuator的management的端口

问题复现:

springdoc:
  use-management-port: true 
  show-oauth2-endpoints: true
  enable-default-api-docs: true
  api-docs:
    groups:
      enabled: false
knife4j:
  enable: true
  cors: false

依赖jar配置如下:

        <dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
            <version>4.5.0</version>
        </dependency>

原因是:
management的端口下面,openapi的swagger-config的地址发生了变化,而Knife4jInsightUploader.jar里面的
String localGroup = "http://localhost:" + commonInfo.getPort() + commonInfo.getContextPath() + "/v3/api-docs/swagger-config";
log.debug("localHost:{}", localGroup);

这段代码不支持配置,导致此功能比较悲催就报错了,找不到swagger-config

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