Thomas T.
09/16/2023, 2:57 PM@Tag(name = "Welcome", description = "Description of the endpoint")
@RestController
class SimpleController {
@Operation(summary = "Get all data")
@ApiResponse(responseCode = "200",
description = "Get all data",
content = [@Content(schema = @Schema(implementation = Dummy.class))])
@GetMapping("/index")
def index() {
//Some stuff
}
@Operation(summary = "Get one record")
@GetMapping("/withparams/{pv}")
def withparams(@PathVariable("pv") String pv) {
//Some stuff
}
}
BTW in Application.groovy
@OpenAPIDefinition(
info = @Info(
title = "App Name",
version = "0.1"
)
)
The application does not start due to the following error:
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'bms.ws.SimpleController' method
bms.ws.SimpleController#withparams(String)
to {GET [/withparams/{pv}]}: There is already 'bms.ws.SimpleController' bean method
bms.ws.SimpleController#withparams() mapped.
Do you have any idea why?