If I use interface

public interface UserAPI {
  @RequestMapping(method = GET, path = "/user/{username:[a-z@A-Z\\d\\.-_]+}"
  UserDTO getUserByUsername();
}

And want to create client as

@FeignClient("service")
public interface UserClient extends UserAPI{}

it won't work because feign thinks that pattern is part of path. It's even more impressive if you want to use pattern like .+

Comment From: jmgilmour

Any timeframe on this being included in an upcoming release?

Comment From: spencergibb

@jmgilmour no. PRs welcome.

Comment From: jmgilmour

Thanks for the quick response. I was under the impression that the referenced commit by @venilnoronha above would fix this issue.

Comment From: spencergibb

That commit merely didn't error if there was a regex, it didn't support them.

Comment From: jmgilmour

Good to know :smile:. I guess I'll take a crack at a fix and PR when I get the chance. Again, thanks for the quick response.

Comment From: kdavisk6

Support for this was added in feign-core 10.x as part of the uri expression updates. It's now possible to define an expression with a pattern and the pattern will be enforced during expansion. Might be straightforward to take advantage here.