I want to add a @ApiImplicitParam Springfox annotation to document on Swagger UI a cookie, required by the service
@GetMapping(value = "cookies")
public void methodA(
@RequestHeader HttpHeaders headers) {
service.checkCookie(headers);
}
I'll try doing
@GetMapping(value = "cookies")
public void methodA(
@ApiImplicitParam(name="cookie", paramType = "header", type = "string") @RequestHeader HttpHeaders headers) {
service.checkCookie(headers);
}
But in Swagger UI don't sent any cookie when I push on Execute button.
Cookie isn't sent, and return a Bad Request 400 code. But If I execute the curl printed, I obtain an OK status.
curl -k -i -X GET "https://localhost:8080/cookies" -H "cookie: KEY=VALUE"
HTTP/1.1 200
Also try with paramType annotation value cookie like this:
@GetMapping(value = "cookies")
public void methodA(
@ApiImplicitParam(name="cookie", paramType = "cookie", type = "string") @RequestHeader HttpHeaders headers) {
service.checkCookie(headers);
}
With the same 400 error