I have this json response back from API:
With result:
{
"Result": {"name":"Jason"},
"Status": 1
}
Without result:
{
"Result": "Not found",
"Status": 1
}
As you can see the format the different.
When using Feign when not found I will certainly hit the conversion error:
@GetMapping(path = "/test", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseDto sendRequest(@RequestParam("id") String ID);
}
Any way to resolve this without changing the API? I will certainly hit with an error
Cannot construct instance of `com.clients.dto.ResponseDto` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Not found.')