swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

DataTypeClass not working in ApiImplicitParam

Open gorokhmn opened this issue 7 years ago • 4 comments

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.

gorokhmn avatar Dec 14 '18 18:12 gorokhmn

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.

pjfanning avatar Jan 05 '19 11:01 pjfanning

My pom.xml declares

<dependency>
  <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
  <version>2.9.2</version>
</dependency>

gorokhmn avatar May 07 '19 20:05 gorokhmn

oh sorry, i've got that is the other swagger

vendelieu avatar Jan 03 '20 12:01 vendelieu

This issue relates to Springfox, not swagger-core. Please file the issue with that project.

webron avatar Jan 06 '20 21:01 webron