Springdoc-OpenAPI with path parameters and command object

Solution 1:

To generate the correct openAPI spec, you can add the swagger-annotations.

@Parameter(in = ParameterIn.PATH, name ="foo" ,schema = @Schema(type = "string"))
@Parameter(in = ParameterIn.PATH, name ="bar" ,schema = @Schema(type = "string"))
@Parameter(in = ParameterIn.PATH, name ="baz" ,schema = @Schema(type = "string"))
@GetMapping("/myPath/{foo}/{bar}/{baz}")
public Mono<MyServiceResponse> doSomethingInteresting(@Valid @Parameter(hidden = true) DoSomethingInterestingCommand command) {
    return interestingService.doSomethingInteresting(command);
}