I want to add a header parameter field in the auto-generated swagger ui documentation of my rest service. I use Spring and Springfox.
public ResponseEntity&l
I just added @RequestHeader(value="myHeader") String headerStr
:
public ResponseEntity saveNewUser(
@RequestHeader(value="myHeader") String headerStr,
@ApiParam(value = "the user to create", required = true) @RequestBody User user) throws RestServiceException {
userService.save(user);
return new ResponseEntity(user, HttpStatus.OK);
}
(import org.springframework.web.bind.annotation.RequestHeader;
)
You can also add a global header on every service in your documentation with the solution described here : Spring + Springfox + Header Parameters