shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[BUG] <SpringMvcClientEventListener#buildApiPath return error apiPath when registering method without @ShenyuSpringMvcClient>

Open sunglasses88 opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

image image

Expected Behavior

The name of the rule registered to shenyu admin should be /http/oauth/authorize

Steps To Reproduce

run module shenyu-examples-http

Environment

ShenYu version(s):2.6.1-SNAPSHOT

Debug logs

No response

Anything else?

No response

sunglasses88 avatar Aug 14 '23 08:08 sunglasses88

use this annotation with method

moremind avatar Aug 14 '23 09:08 moremind

use this annotation with method

I don't think it's a good idea to use @ShenyuSpringMvcClient everywhere. In fact, the implementation logic of the SpringMvcClientEventListener#buildApiPath function is that if the client annotation doesn't get the path, it will demote the requestMapping annotation to get the path. what causes the problem is that before calling this function, if the variable methodShenyuClient is null, it assigns the beanShenyuClient to the variable methodShenyuClient.

sunglasses88 avatar Aug 14 '23 09:08 sunglasses88

a good idea to use @ShenyuSpringMvcClient everywhere. In fact, the implementation logic of the SpringMvcClientEventListener#buildApiPath function is that if the client

need discuss~

moremind avatar Aug 15 '23 15:08 moremind