How to use jackson to deserialize nested json fields to objects

< H2 > how to use jackson to deserialize nested json fields to objects < / H2 >
{
"id":1,
"name":"Bitcoin",
"quote":{
"USD":{
"price":9283.92,
"market_cap":158055024432
}
}
}

deserialize the above json to the following object

public class TokenInfo implements Serializable {
    private String name;
    private String id;
    private BigDecimal price;
    private BigDecimal marketCap;
}

can be handled manually, but I don"t want to repeat it if jackson supports it by default.

has anyone ever encountered such a scenario, please give us some advice on the solution

Sep.07,2021

allows your TokenInfo class to have a field quote , and the quote field is the class Quote (you need to declare it). It's been nested all the time.
tokenInfo.getQuote (). GetUSD (). GtPrice () take a value like this.

Menu