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

knife4j 扫不到接口 #3

Open
zenmo972 opened this issue Jul 5, 2024 · 1 comment
Open

knife4j 扫不到接口 #3

zenmo972 opened this issue Jul 5, 2024 · 1 comment

Comments

@zenmo972
Copy link

zenmo972 commented Jul 5, 2024

因为新版本不需要静态链接,改application.yml 文件的配置。

springdoc:
  swagger-ui:
    path: /swagger-ui.html
    tags-sorter: alpha
    operations-sorter: alpha
  api-docs:
    path: /v3/api-docs
  group-configs:
    - group: 'default'
      paths-to-match: '/**'
      packages-to-scan:   ## 此处改为需要扫描的包路径

你用的还是 com.github.xiaoymin.boot3 肯定扫不出来啊

@Tilia-ars
Copy link

Knife4j不能直接使用 Springdoc OpenAPI 的配置。Knife4j 的配置应该是独立的,且不需要与 Springdoc 的配置混合。你可以这样修改 application.yml:

knife4j:
enabled: true
swagger-ui:
base-url: /swagger-ui
api-docs:
path: /v3/api-docs
group-configs:
- group: 'default'
paths-to-match: '/**'
packages-to-scan: com.example.controller # 确保这里是你的控制器包

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

2 participants