You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public interface TuyaClient {
@GET("/v1.0/devices/{device_id}")
Device getById(@Path("device_id") String deviceId);
}
Device.java:
@Data
@AllArgsConstructor
@NoArgsConstructor
@FieldDefaults(level = AccessLevel.PUBLIC)
public class Device {
String id;
@JSONField(name="update_time")
Long update_time;
@JSONField(name="create_time")
Long createTime;
Boolean online;
String icon;
// other fields here
}
我正在使用 tuya-spring-boot-starter 版本 1.3.0 来查询设备详细信息,如下所示:
TuyaClient.java:
Device.java:
问题:
某些字段(例如“update_time”)没有被 Fastjson 反序列化,没有明确的原因,从而产生以下错误:
调用连接器时出错。 原因:com.alibaba.fastjson.JSONException:设置属性错误,mypackage.models.Device#update_time"
我想知道为什么会发生这种情况,因为例如,与“update_time”具有相同类型的字段“create_time”正在被正确反序列化。
有什么线索吗?
Java version: 20
tuya-spring-boot-starter: 1.3.0
The text was updated successfully, but these errors were encountered: