Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The java.util.Set does not work as @RequestParam in Greenwich.SR1 #143

Closed
Ziemowit opened this issue Mar 8, 2019 · 3 comments
Closed

The java.util.Set does not work as @RequestParam in Greenwich.SR1 #143

Ziemowit opened this issue Mar 8, 2019 · 3 comments
Assignees
Labels
bug Something isn't working in progress
Milestone

Comments

@Ziemowit
Copy link

Ziemowit commented Mar 8, 2019

After upgrade:

  • from spring-boot 2.0.8.RELEASE / spring-cloud Finchley.SR3
  • to spring-boot 2.1.3.RELEASE / spring-cloud Greenwich.SR1

our @FeignClient has an issue with passing java.util.Set as @RequestParam

@RequestMapping("foo/{applicationId}/tools")
@FeignClient(name = "service-foo")
public interface ProxyShareTool {

  @GetMapping("/findDefaultIfVisibleByIds")
  Map<Long, TranslatedShareToolDTO> findVisible(@PathVariable("applicationId") String appId,
                                                @RequestParam("waveIds[]") Set<Long> waveIds,
                                                @RequestParam("lang") String lang);
}

After decode generated request we see following:

findDefaultIfVisibleByIds?waveIds[]={waveIds[]}&lang=en

So seems that instead of ids following text was inserted

{waveIds[]}

@ryanjbaxter ryanjbaxter added bug Something isn't working and removed waiting-for-triage labels Mar 11, 2019
@ryanjbaxter ryanjbaxter added this to To do in Greenwich.SR2 via automation Mar 11, 2019
@ryanjbaxter ryanjbaxter added this to the 2.1.2.RELEASE milestone Mar 11, 2019
@OlgaMaciaszek OlgaMaciaszek self-assigned this Mar 11, 2019
@sN0wpeak
Copy link

I have same problem in Greenwich.RELEASE. I use @RequestParam("ids[]") List<Integer> ids as params.
result is:

{"timestamp":"2019-03-18T14:30:35.821+0000","status":400,"error":"Bad Request","message":"Failed to convert value of type 'java.lang.String' to required type 'java.util.List'; nested exception is java.lang.NumberFormatException: For input string: \"{ids[]}\"","path":"/"}

I found it caused by not matched Expression in Expressions.
Shall we put the (Pattern.compile("(\\w[-\\w.]*[ ]*[\\[]*[\\]]*)(:(.+))?"), Expressions.SimpleExpression.class) or create a new Expression in the expressions?

@OlgaMaciaszek
Copy link
Collaborator

Hello, @Ziemowit @mm23504570 Thanks for reporting this. I have triaged it and it appears to be an actual bug, however, its root cause can be found in the OpenFeign library. I have created this issue and will be back here with any updates as soon as possible.

@OlgaMaciaszek OlgaMaciaszek added this to To do in Hoxton.M1 via automation May 13, 2019
@OlgaMaciaszek OlgaMaciaszek moved this from To do to In progress in Hoxton.M1 May 16, 2019
Hoxton.M1 automation moved this from In progress to Done May 17, 2019
Greenwich.SR2 automation moved this from In progress to Done May 17, 2019
@Ziemowit
Copy link
Author

Hooray!!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress
Projects
No open projects
Greenwich.SR2
  
Done
Hoxton.M1
  
Done
Development

No branches or pull requests

5 participants