swagger-core
swagger-core copied to clipboard
DataTypeClass not working in ApiImplicitParam
| Q | A |
|---|---|
| Bug or feature request? | Bug |
| Which Swagger-Core version? | 2.9.2 |
| Which Java version? | 1.8.0_192 |
Code to demo the issue:
@RequestMapping(value="getData")
@ResponseBody
@ApiOperation(value="Get data", notes="Returns data", response=MyResponseDto.class)
@ApiImplicitParam(name="jsonRequest", value="Query", required=true,
dataTypeClass=MyRequestDto.class, paramType="body")
public String getData(@RequestBody String jsonRequest) {
. . .
}
The Swagger annotation @ApiOperation is working nicely for response MyResponseDto.class and fails for annotation @ApiImplicitParam - returns String instead of MyRequestDto.class
Seems to be annotation parameters are declared as required.
There is no swagger-core 2.9.2 - 2.0.6 is the latest release. The code snippet appears to be for swagger-core 1.5.x though.
My pom.xml declares
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
oh sorry, i've got that is the other swagger
This issue relates to Springfox, not swagger-core. Please file the issue with that project.