Forum Discussion

rohitdgpcool's avatar
3 years ago

OpenAPI codegen issue for Webflux API

Hi Team,

Our team has been facing an issue when we try to use CodeGen with OpenAPI version 3.0.3 where I try to generate the Delegate and Api for a service where the request body is as follows:

requestBody:
required: true
content:
image/*:
schema:
type: string
format: binary
application/octet-stream:
schema:
type: string
format: binary

 The problem here is that the API generated is having a signature as following:

default Mono<ResponseEntity<Object>> postStoreImage(@NotNull @ApiParam(value = "Domain name for storing objects", required = true, allowableValues = "PRESCRIPTION", defaultValue = "PRESCRIPTION") @Valid @RequestParam(value = "origin", required = true, defaultValue="PRESCRIPTION") String origin,@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono<org.springframework.core.io.Resource> body, @ApiIgnore final ServerWebExchange exchange) {
return getDelegate().postStoreImage(origin, body, exchange);
}

And then the Delegate implementation generated is as follows: 

default Mono<ResponseEntity<Object>> postStoreImage(String origin,    Flux<Part> body,    ServerWebExchange exchange) {
    Mono<Void> result = Mono.empty();    exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);    return result.then(Mono.empty());
}

This always raises a compilation issue even if I Override the default method in a new Implementation class in my project. Please help 

No RepliesBe the first to reply