api 响应的 POJO,其键为“-”

POJO for api response which has key with '-'

我的 api 回复 return 以下回复正文。我必须为此 api 响应创建一个 POJO。

 {
            "time-since-created": 115,
            "img_url": "<Image url>",
            "heading": "Waiting for image upload",
            "name": "How are you?",
    }

其他 3 个的私有变量将是

private String img_url;
private String heading; 
private String img_url;

但是 time-since-created 的变量给出了一个错误

Can not deserialize instance

使用@JsonProperty :

@JsonProperty("time-since-created")
private Integer timeSinceCreated;