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

@ApiImplicitParams has no effect while generating swagger.json

Open thegreatdao opened this issue 11 years ago • 1 comments

Hi, I'm currently working on migrating swagger from 1.3 to 1.5. Currently using 1.5.1-M2

All ApiImplicitParams annotations worked on swagger 1.3 with maven swagger plugin. When switching to use swagger servlet in web.xml, both @ApiOperation and @ApiResponse annotations worked, but @ApiImplicitParams.

Snippet of my code:

@Path("/api") @POST @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @ApiOperation( value = "Authenticate API", response = LoginResponse.class, httpMethod = HTTP_METHOD_POST, position = 1) @ApiImplicitParams(value = { @ApiImplicitParam(name = PARAM_API_KEY, dataType = DATA_TYPE_STRING, paramType = PARAMETER_TYPE_BODY, required = true, value = "api key"), @ApiImplicitParam(name = PARAM_API_SECRET, dataType = DATA_TYPE_STRING, paramType = PARAMETER_TYPE_BODY, required = true, value = "api secret"), @ApiImplicitParam(name = HEADER_APPLICATION_UUID, dataType = DATA_TYPE_STRING, paramType = PARAMETER_TYPE_HEADER, required = true, value = DESC_HEADER_APPLICATION_UUID), @ApiImplicitParam(name = HEADER_VERSION_CODE, dataType = DATA_TYPE_STRING, paramType = PARAMETER_TYPE_HEADER, required = true, value = DESC_HEADER_VERSION_CODE), @ApiImplicitParam(name = HEADER_USER_AGENT, dataType = DATA_TYPE_STRING, paramType = PARAMETER_TYPE_HEADER, required = true, value = DESC_HEADER_USER_AGENT) }) @ApiResponses(value = { @ApiResponse(code = STATUS_CODE_201, message = SUCCESSFUL_MESSAGE), @ApiResponse(code = STATUS_CODE_401, message = "Unauthorized exception due to invalid api credential") }) public Response authenticateApi(@ApiParam(access = API_PARAMETER_INTERNAL_ACCESS) @InjectParam LoginAPICommand loginAPI) { return status(CREATED).entity(authService.authenticateAPI(loginAPI)).build(); }

In swagger.json there is no information generated for any of the apiImplicitParams I declared on the method.

Am I missing anything?

Thanks, H

thegreatdao avatar May 19 '15 16:05 thegreatdao

@ApiImplicitParam support is not yet implemented for 1.5. Please follow https://github.com/swagger-api/swagger-core/issues/905.

webron avatar May 19 '15 16:05 webron