feign-form
feign-form copied to clipboard
FormEncoder bug
https://github.com/OpenFeign/feign-form/blob/98e51d187f1b7acba3b39d1131371b761d87259b/feign-form/src/main/java/feign/form/FormEncoder.java#L95
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);
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);