To provide configuration properties for legacy apps we have to retrieve the configuration by file using one of the paths - /{label}/{application}-{profile}.yml - /{label}/{application}-{profile}.json - /{label}/{application}-{profile}.properties
unfortunately these path are not working anymore. Instead of being routed to the corresponding endpoint in the class org.springframework.cloud.config.server.environment.EnvironmentController annotated with - @GetMapping({ "/{label}/{name}-{profiles}.yml", "/{label}/{name}-{profiles}.yaml" }) - @GetMapping("/{label}/{name}-{profiles}.json") - @GetMapping("/{label}/{name}-{profiles}.properties")
they are all routed to the method annoteted with: @GetMapping(path = "/{name}/{profiles:.[^-].}", produces = MediaType.APPLICATION_JSON_VALUE) which is completely wrong.
I then tried to find out what goes wrong but i stuck in the method org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(String, HttpServletRequest) and there on the lines
Comparator
the sorted result is different between Spring Cloud 2021.0.0, Spring Boot 2.6.x where its wring and Spring Cloud 2020.0.4, Spring Boot 2.5.8 where it was working and therefore the variable bestMatch contains the wrong path.
Comment From: ryanjbaxter
Sounds like it might be a duplicate of https://github.com/spring-cloud/spring-cloud-config/issues/2020?
Comment From: hpoettker
I think the old behavior should return if the property spring.mvc.pathmatch.matching-strategy: ant_path_matcher
is set.