I have a REST Controller in a Spring Boot 3 application. The controller has a post mapping as follows:
@PostMapping(value = { "/save", "/save/" })
@Operation(summary = "Method summary", responses = { @ApiResponse(responseCode = 200, description = "A description")})
public ResponseEntity<String> doSomething(@RequestBody SomeClass body) {
...
}
- Spring Boot version
3.4.2
- Springdoc OpenAPI library -
.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.5
There are two separate entries in Swagger-UI for /save
and /save/
. This is expected as they are separate paths. But this is redundant for the user as both paths perform the same function from a business logic perspective.
How do I configure Springdoc to show only one entry for the @PostMapping
for either /save
or /save/
but not both? I'm assuming the approach is to ignore or disable documentation for one of the paths.