AppThreat / atom

Atom is a novel intermediate representation for applications and a standalone tool that is powered by chen.
https://appthreat.com
Apache License 2.0
52 stars 2 forks source link

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

Open sohitgore opened 6 months ago

sohitgore commented 6 months ago

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}

prabhu commented 6 months ago

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.

sohitgore commented 2 months ago

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?