Closed
Description
Describe the feature
in my project, i need to add prefix for all @RestController beans mapping. so i add this config class:
@Configuration
public class AppConfiguration implements WebMvcConfigurer {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.addPathPrefix("/rest",
HandlerTypePredicate.forAnnotation(RestController.class));
}
}
after that i see swagger not preview correctly with default address, so I add this config keys:
springdoc.swagger-ui.path= swagger
springdoc.swagger-ui.url= /rest/api-docs
now i see this page with correct controller mapping but when i try it, url add prefix again and address change to /rest/rest/...
@RestController
public class WorkflowController {
private final WorkflowService workflowService;
private final Environment environment;
public WorkflowController(WorkflowService workflowService, Environment environment) {
this.workflowService = workflowService;
this.environment = environment;
}
@PostMapping(value = "/phoneCharge")
public GeneralResponse startChargeProcess(@Valid @RequestBody MerchantChargeRequestDto dto, HttpServletRequest request) {
return workflowService.startChargeProcess(dto, request.getRemoteAddr(), "ChargeProcess");
}
}
I use this versions:
spring-boot-starter-parent => 2.3.12.RELEASE
springdoc-openapi-data-rest & springdoc-openapi-ui => 1.5.9