Springfox: Swagger doesnt ignore Spring parameter

Created on 17 Oct 2017  路  1Comment  路  Source: springfox/springfox

cannot ignore spring variables like HttpSession or HttpRequest

<springfoxVersion>2.5.0</springfoxVersion>

Sample:

@Api()
@Controller
@RequestMapping(value="/preview", produces = "application/json; charset=UTF-8", method = {RequestMethod.GET})
public class BController {

...

@ApiOperation(value = "")
  @RequestMapping(value = "/requestContext/{id:.+}", method = {RequestMethod.GET}, produces="application/json; charset=UTF-8")
  public @ResponseBody RequestContext getRequestContext(@PathVariable String id, HttpSession session) {

Both doesnt ignore HttpSession
@ApiParam(hidden = true) HttpSession session @ApiIgnore HttpSession session

Always get following error:

Resolver error at paths./preview/requestContext/{id}.get.parameters.1.schema.$ref
Could not resolve reference because of: Could not resolve pointer: /definitions/HttpSession does not exist in document

https://github.com/swagger-api/swagger-ui/issues/3765

question

Most helpful comment

that resolve the issue
new Docket(DocumentationType.SWAGGER_2).ignoredParameterTypes(ApiIgnore.class) ...

>All comments

that resolve the issue
new Docket(DocumentationType.SWAGGER_2).ignoredParameterTypes(ApiIgnore.class) ...

Was this page helpful?
0 / 5 - 0 ratings