Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overloaded controller methods in Swagger

I have a Spring REST application. I am using Swagger for API documentation purpose.

What I have any my REST controllers are, methods with @RequestMapping. I have two overloaded methods, they differ in terms of arguments. But Swagger UI only shows one.

Is it my approach which is wrong (overloading controller methods) or it is a bug in Swagger?

like image 870
Soumitri Pattnaik Avatar asked Dec 14 '22 05:12

Soumitri Pattnaik


1 Answers

It is a limitation in swagger specification. However if you are using springfox, you can configure your Docket with docket.enableUrlTemplating(true). This will allow your overloaded methods to show up in the service document.

like image 91
Dilip Krishnan Avatar answered Dec 17 '22 01:12

Dilip Krishnan