swagger-api / swagger-api/swagger-codegen

[Java] Controller not recognized when using LoggingAspect(AspectJ)

Open
#4,227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

The controller cannot be seen in swagger ui when using aspectj for logging.

The problem is within the proxying mechanism of JDK proxy, the @Controller annotation is placed in the implementation class and thus, not being seen in the JDK generated proxy.

Swagger-codegen version

2.2.1

Steps to reproduce

Use AspectJ to log method ins and outs for tracing the controller

Suggest a Fix

Add the Controller annotation in the generated interface to support AspectJ logging in the controller.
commit

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Java server-stub generation path and the controller interface produced for JDK proxies. Reproduce the AspectJ logging setup described in the issue and compare annotation visibility on the implementation and generated interface. Done means the controller is recognized in Swagger UI when AspectJ logging is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.