Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

FormEncoder bug #109

Open
redjiang opened this issue May 18, 2022 · 1 comment
Open

FormEncoder bug #109

redjiang opened this issue May 18, 2022 · 1 comment

Comments

@redjiang
Copy link

if (MAP_STRING_WILDCARD.equals(bodyType)) {

if bodyType‘s typeName is "java.util.map<java.lang.String, java.lang.Object>" cannot correct match

eg:
@RequestLine("POST /user")
@headers("Content-Type: application/x-www-form-urlencoded")
void addUser (Map<String,Object> stringObjectMap);

@molsza
Copy link

molsza commented Jul 13, 2022

It also cannot recognize the org.springframework.util.MultiValueMap.

So for example this method will never send a body:

  @PostMapping(consumes = MediaType.APPLICATION_FORM_URLENCODED)
  ResponseEntity<ObjectNode> requestForSomething(@RequestBody MultiValueMap<String, String> params);

The workaround for this is

  @PostMapping(consumes = MediaType.APPLICATION_FORM_URLENCODED)
  ResponseEntity<ObjectNode> requestForSomething(@RequestBody Map<String, ? extends Object> params);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants