Guide
- The back-end interface field defined by the interface document is named package. For java, this is a keyword and cannot be used as an attribute name (as shown in the figure below)
the reason
- Key words are used to name attribute names in JavaBean.
Solution
- Use fastjson's @JsonProperty annotation to solve this problem
import com.alibaba.fastjson.annotation.JSONField;
@Data
public class Bean {
@JsonProperty(value = "package")
private String pak;
}