【发布时间】:2021-07-07 15:49:08
【问题描述】:
我一直在研究这个问题,但找不到适合我的情况的解决方案...
我尝试发送 JSON 数组,但收到此错误,我已调查此问题,但我 100% 无法理解问题,因此我不知道从哪里攻击它。
详细错误
{
"type" : "https://www.jhipster.tech/problem/problem-with-message"
"title" : "Bad Request",
"status" : 400,
"detail" : "JSON parse error: Cannot deserialize instance of `java.lang.Long` out of START_ARRAY token;
nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.Long` out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 74] (through reference chain: com.curtipieles.app.service.dto.LeatherDTO[\"usageId\"])",
"path" : "/api/leathers",
"message" : "error.http.400"
}
PD:后端是在 JHIPSTER
中生成的这是我的 DTO:
private Long usageId;
private Long colorId;
public Long getColorId() {
return colorId;
}
public void setColorId(Long colorId) {
this.colorId = colorId;
}
public String getColorName() {
return colorName;
}
public void setColorName(String colorName) {
this.colorName = colorName;
}
public Long getUsageId() {
return usageId;
}
public void setUsageId(Long usageId) {
this.usageId = usageId;
}
public String getUsageUsage() {
return usageUsage;
}
public void setUsageUsage(String usageUsage) {
this.usageUsage = usageUsage;
}
【问题讨论】:
标签: angular spring-boot jhipster