Nested pojo & extending another POJO
public static class Temp {
private String name;
private int age;
private List<String> list;
private Nested nested;
private Map<String, List<String>> map;
public Temp(){}
public Temp(String name, int age, List<String> list, Nested nested,
Map<String, List<String>> map) {
this.name = name;
this.age = age;
this.list = list;
this.nested = nested;
this.map = map;
}
// Getter, Setter toString ...
}
public class Nested {
private String title;
public Nested() {
}
// Getter Setter etc ...
}
`
im testing feign for http client of my spring boot project
when i use api like below with POJO parameter typed Temp
@PostMapping(value = "/temp",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
String formEncodedPost(Temp temp);
It seemd that FormEncoder(accurately PojoUtil) just set Nested.toString() for 'title' property of Nested class
so when i log Nested instance
logger say "Nested{title='Nested{title='title 1'}"
this is debugging log for client side
[POST /form HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
User-Agent: Java/1.8.0_222
Host: localhost:8080
Connection: keep-alive
Content-Length: 77
name=tempName&list=1&list=2&list=3&nested=**Nested%7Btitle%3Dtitle+1%7D**&age=100]
and below is server side log ` Start processing with input [name=tempName&list=1&list=2&list=3&nested=Nested%7Btitle%3Dtitle+1%7D&age=100]
`
and nest Map or HashMap or LinkedMultiValueMap not works well. (server said, can not convert String to map)
this is bug? or intended action?
And maybe extending another pojo not works -> feign encode data to body only properties in child POJO
can be connected with: #95