Closed AllenLVieira closed 1 year ago
/cc @Sgitario (rest-client), @cescoffier (rest-client), @geoand (jackson,rest-client), @gsmet (jackson)
I put @JsonProperty("USDBRL") in CurrencyPriceDTO and works. But don't understand if is really a need
This is just a mapping issue - not a problem in Quarkus or Jackson
Describe the bug
Rest Client seems to not work with @Jacksonized. He always came back as null, and when I tried to return in a String or Object the response for rest client exists. But in my CurrencyPriceDTO class with the annotation came as null.
Expected behavior
public void getCurrencyPrice() { CurrencyPriceDTO currencyPriceInfo = currencyPriceClient.getPriceByPair("USD-BRL"); if (isPriceUpdateNeeded(currencyPriceInfo)) { QuotationDTO quotationDTO = createQuotationDTO(currencyPriceInfo); kafkaEvents.sendNewKafkaEvent(quotationDTO); } }
Sould return a CurrencyPriceDTO populated. The rest Client goes to:https://economia.awesomeapi.com.br/last/USD-BRL and the response in insomnia is: {"USDBRL":{"code":"USD","codein":"BRL","name":"Dólar Americano/Real Brasileiro","high":"4.9813","low":"4.9391","varBid":"0.0255","pctChange":"0.52","bid":"4.9644","ask":"4.9659","timestamp":"1684439302","create_date":"2023-05-18 16:48:22"}}
Actual behavior
When the line: CurrencyPriceDTO currencyPriceInfo = currencyPriceClient.getPriceByPair("USD-BRL"); is reached, the object came as null
How to Reproduce?
Steps to reproduce the behavior:
Output of
uname -a
orver
MINGW64_NT-10.0-22621 LAPTOP-SQNAPR6A 3.3.6-341.x86_64 2022-09-05 20:28 UTC x86_64 Msys
Output of
java -version
java version "17.0.5" 2022-10-18 LTS Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191) Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.0.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39) Maven home: C:\Users\allen.m2\wrapper\dists\apache-maven-3.8.8-bin\67c30f74\apache-maven-3.8.8 Java version: 17.0.5, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-17.0.5 Default locale: pt_BR, platform encoding: Cp1252 OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
Additional information
Github code if needed to: https://github.com/AllenLVieira/quarkus-cotacao