spring-cloud / spring-cloud/spring-cloud-openfeign

Feign doesn't support regexp in request mapping

Open
#123 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Java
Stars
1.3k
Forks
838
Avg merge
2d 11h
Merged PRs (30d)
13

Description

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 .+

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files or tests. Start by reproducing the @RequestMapping example with a Feign client and inspect how the path pattern is interpreted; done means regex-constrained mappings, including patterns such as .+, are accepted without treating the pattern as part of the request path.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.