Я могу получить ответ, но когда я конвертирую его в dto, все значения равны нулю.Это dto:
Код: Выделить всё
public class AddressResponse {
private String street;
private String line1;
private String line2;
private String postcode;
private String country;
}
Код: Выделить всё
public AddressResponse resolveAddress(AddressRequest addressRequest) {
return webClient.get()
.uri(uriBuilder -> uriBuilder
.queryParam("text", addressRequest.getSearchTerm())
.queryParam("apiKey", apiKey)
.build())
.retrieve()
.bodyToMono(AddressResponse.class)
.block();
}
Код: Выделить всё
"results": [
{
"datasource": {
"sourcename": "openstreetmap",
"attribution": "© OpenStreetMap contributors",
"license": "Open Database License",
"url": "https://www.openstreetmap.org/copyright"
},
"name": "Bermondsey",
"country": "United Kingdom",
"country_code": "gb",
"state": "England",
"county": "Greater London",
"city": "London"
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/761 ... java-dto-i
Мобильная версия