The response from postman is
{
"relation": [
{
"trans_id": 1,
"data": {
"PLC_id": 1,
"temp_id": 1,
"sla_id": 1
}
}
]
}
The way to get a response is
Mono<ClientResponse> response = WebClient.builder()
.baseUrl(baseUrl)
.build()
.post()
.uri("/sync")
.contentType(MediaType.APPLICATION_JSON_UTF8)
.accept(MediaType.APPLICATION_JSON_UTF8)
.syncBody("{\"id\":1}")
.exchange();
Info result = response.block().bodyToMono(Info.class).block();
But the result is like
Info(relation=[Trans(trans_id=1, data=PLC(PLC_id=null, temp_id=1, sla_id=1))])
The POJO PLC class is
import lombok.Data;
@Data
public class PLC {
private Integer PLC_id;
private Integer temp_id;
private Integer sla_id;
}
The spelling is checked several times, they are identical.
So why the PLC_id
is null? What could be the problem?
My problem is different from Part of JSON response from server is returning null: Android It's missing a key, while I have the key but with null value.