I have a spring webapp, i've aadded swagger and swagger-ui. I've added a dummy class to test swagger:
import com.wordnik.swagger.annotations.Api; import com.wordnik.swagger.annotations.ApiError; import com.wordnik.swagger.annotations.ApiErrors; import com.wordnik.swagger.annotations.ApiOperation; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @Api(value = "DummyController", description = "Dummy description for the controller") @Controller @RequestMapping(value = "/dummy") public class DummyClassForSwagger { @ApiOperation(value = "First dummy output", httpMethod = "GET") @ApiErrors({@ApiError(code = 404, reason = "First dummy test") }) @RequestMapping(value = "/first", method = RequestMethod.GET) @ResponseBody public String dummyOutputOne() { return "Dummy output"; } @ApiOperation(value = "Second dummy output", httpMethod = "GET") @ApiErrors({@ApiError(code = 404, reason = "Second dummy test") }) @RequestMapping(value = "/second", method = RequestMethod.GET) @ResponseBody public String dummyOutputTwo() { return "Second dummy output"; } }
After build/deploy i can see the dummy class on the swagger page (see attachment 1). The problem is, that "List operations" doesn't show anything. The raw output is as follow:
<controllerDocumentation>
<apiVersion>1.0</apiVersion>
<apis>
<description>Dummy description for the controller</description>
<operations>
<deprecated>false</deprecated>
<errorResponses>
<code>404</code>
<reason>First dummy test</reason>
</errorResponses>
<httpMethod>GET</httpMethod>
<nickname>dummyOutputOne</nickname>
<notes/>
<responseClass>String</responseClass>
<summary>First dummy output</summary>
</operations>
<path>/dummy/first</path>
</apis>
<apis>
<description>Dummy description for the controller</description>
<operations>
<deprecated>false</deprecated>
<errorResponses>
<code>404</code>
<reason>Second dummy test</reason>
</errorResponses>
<httpMethod>GET</httpMethod>
<nickname>dummyOutputTwo</nickname>
<notes/>
<responseClass>String</responseClass>
<summary>Second dummy output</summary>
</operations>
<path>/dummy/second</path>
</apis>
<basePath>http://localhost:8080/mapserver/core</basePath>
<models/>
<resourcePath>/dummy</resourcePath>
<swaggerVersion>1.0</swaggerVersion>
</controllerDocumentation>
I think, the problem is a missing tag "operation" or something like this...but i'm not sure (and i don't know, how to fix this). Any suggestions?