Artem Eduardov
Artem Eduardov

Reputation: 86

De-serialize Java class using alibaba fastjson

I'm trying to de-serialize class from JSON string using library com.alibaba.fastjson. This is the class:

@Getter
@ToString
@Setter
@JSONType(naming = PropertyNamingStrategy.CamelCase)
   public class SiteInfo {
   private String id;
...
   @JSONField(name = "keywords")
   private String keyWords;
...
}

After I run the code, the value of keyWords=null; In other hand, if I changing it to "private String keywords;" everything works fine. So I can't use the camelcase (according to java conventions). In need some thing similar like @JsonProperty("keywords") from Jackson library, but for the alibaba fast json.

Upvotes: 0

Views: 1008

Answers (0)

Related Questions