Pre-check

  • [x] I am sure that all the content I provide is in English.

Search before asking

  • [x] I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

dubbo version: 3.3.5 Oracle OpenJDK 21.0.3 Windows10 Intellij IDEA

Steps to reproduce this issue

@RequestMapping("/demo")
public interface DemoService {

    @GetMapping("/{id}")
    String getId(@PathVariable Integer id);

    @DeleteMapping("/{id}")
    String deleteById(@PathVariable Integer id);
}
@DubboService
public class DemoServiceImpl implements DemoService {

    private static final String PREFIX = "Hello ";


    @Override
    public String getId(Integer id) {
        return  PREFIX + id;
    }

    @Override
    public String deleteById(Integer id) {
        return  PREFIX + id;
    }

What you expected to happen

When the path variable is consistent, the get method cannot appear together with the delete method Calling the get method will result in an error,but the delete method won't make a rest call locally, such as using Postman GET http://localhost:50051/demo/22222 Response: { "message": "Request method 'GET' not supported", "status": "405" }

DELETE http://localhost:50051/demo/22222 Response: "Hello 22222"

But when the path variable is different,one is /get/{id}, and the other is /delete/{id},This will not cause any errors

 @GetMapping("/get/{id}")
  String getId(@PathVariable Integer id);

 @DeleteMapping("/delete/{id}")
  String deleteById(@PathVariable Integer id);

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • [ ] Yes I am willing to submit a pull request on my own!

Code of Conduct