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

OpenAPI spec generation in Java Spring does not prefix endpoints with the RequestMapping #143

Open
Sohit1212 opened this issue May 10, 2024 · 2 comments

Comments

@Sohit1212
Copy link

Sohit1212 commented May 10, 2024

Describe the issue

When trying to generate openAPI spec for a java Spring application using atom and atom-tools,
the endpoints in generated spec are missing the @RequestMapping prefix path
eg.

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private TransactionService transactionService;
    @Autowired
    private BalanceService balanceService;
    @Autowired
    private MailService mailService;
    @Autowired
    private UserService userService;
    @Autowired
    PasswordEncoder passwordEncoded;

    @GetMapping("/balance/{accountNo}")

Here the generated openAPI spec has endpoint /balance/{accountNo}
whereas the actual endpoint should be /user/balance/{accountNo}

@Sohit1212 Sohit1212 changed the title OpenAPI spec generation in Java Spring does not prefix RequestMapping OpenAPI spec generation in Java Spring does not prefix endpoints with the RequestMapping May 10, 2024
@prabhu
Copy link
Contributor

prabhu commented May 10, 2024

Nice bug. We have a similar issue in Python with blueprint apps. I am a bit busy till end of June, but will try to think of a way to propagate class annotations to the method level.

@Sohit1212
Copy link
Author

Nice bug. We have a similar issue in Python with blueprint apps. I am a bit busy till end of June, but will try to think of a way to propagate class annotations to the method level.

Hey @prabhu thanks for acknowledging, is there a plan to address this bug?

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