Skip to content

[BUG] - Jimmer OpenApi UI cannot recognize all Controllers in a Spring Modulith project. #938

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

Closed
ccmjga opened this issue Feb 24, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@ccmjga
Copy link

ccmjga commented Feb 24, 2025

Jimmer Version

0.9.59

JDK Version

JDK17

Database

PostgreSQL

OS

Mac

Expected behavior

All of the following controllers are expected to be recognized and displayed in the swagger-ui

Jimemr-OpenApi Config:

Actual behavior

Only the controllers in the https://github.com/ccmjga/mjga-scaffold/tree/model-first/src/main/java/com/zl/mjga/user/web

directory are effectively recognized.

Image
Image

Description

I'm not entirely sure whether this is a bug in Spring Modulith itself or an issue with Jimmer OpenApi. Because the client code generated by Jimmer correctly recognizes all Controllers.

browser.zip

If I discover any clues about how the integration of Spring Modulith with SpringDoc/OpenApi might be causing this problem, I will promptly provide an update.

Reproduction steps

  1. Start project https://github.com/ccmjga/mjga-scaffold/blob/model-first/src/main/java/com/zl/mjga/ApplicationService.java
  2. http://localhost:8080/swagger-ui.html

Generated SQL

No response

Relation Model

No response

Screenshots

No response

Logs

No response

@ccmjga ccmjga added the bug Something isn't working label Feb 24, 2025
@ccmjga ccmjga changed the title [BUG] - Jimmer OpenApi cannot recognize all Controllers in a Spring Modulith project. [BUG] - Jimmer OpenApi UI cannot recognize all Controllers in a Spring Modulith project. Feb 24, 2025
@babyfish-ct
Copy link
Owner

Execution failed for task ':compileJava'.
> Compilation failed; see the compiler output below.
  /Users/chentao/Downloads/mjga-scaffold-main/src/main/java/com/zl/mjga/repository/UserRoleMapRepository.java:12: 错误: 找不到符号
  public class UserRoleMapRepository extends UserRoleMapDao {
                                             ^
    符号: 类 UserRoleMapDao
  /Users/chentao/Downloads/mjga-scaffold-main/src/main/java/com/zl/mjga/repository/RoleRepository.java:24: 错误: 找不到符号
  public class RoleRepository extends RoleDao {
                                      ^
    符号: 类 RoleDao
  /Users/chentao/Downloads/mjga-scaffold-main/src/main/java/com/zl/mjga/repository/UserRepository.java:24: 错误: 找不到符号
  public class UserRepository extends UserDao {
                                      ^
后续内容雷同,省略

@babyfish-ct
Copy link
Owner

让Controller的方法public即可

@babyfish-ct
Copy link
Owner

下个版本,加一个验证机制。web方法必须public,否则不启动,比spring更严格

@ccmjga
Copy link
Author

ccmjga commented Feb 26, 2025

让Controller的方法public即可

改为 public 后问题解决,感谢。

Image

@ccmjga ccmjga closed this as completed Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants