I have an folowing endpoint:
@PostMapping(value = "/home", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
public Mono<String> getData(ServerWebExchange exchange) { return Mono.empty(); }
The ServerWebExchange object is implemented in org.springframework.web.server. When I run it, in Swagger all the getters objects are shown. While I only need the body (I want to hide the reqest and the respone objects).
Tried to use
.ignoredParameterTypes(Principal.class, ServerHttpRequest.class, ServerHttpResponse.class)
But, it didn't had any effect. Is there a way to hide those?
Solution found:
Disable the SeverWebExchange interface for swagger
Configure require input.
@PostMapping(value = "/home", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
@ApiImplicitParams({
@ApiImplicitParam(name = "Body Params", paramType = "body")
})
public Mono<String> getData(
@ApiIgnore ServerWebExchange exchange
) {
return Mono.empty();
}