【发布时间】:2020-09-08 08:28:10
【问题描述】:
我正在使用带有 JPA 的 spring-boot。我想摆脱多余的 JSON。正确的做法是什么?
拥有(默认):
{
"latitude":20.0,
"longitude":20.0,
"picturesURLs": [
"google.com",
"unaimagen.com"
],
"animal":{
"id": 1
},
"usuario": {
"id": 1
},
"longitudAnimal": "123.345"
}
想要:
{
"latitude":20.0,
"longitude":20.0,
"picturesURLs": [
"google.com",
"unaimagen.com"
],
"animal": 1,
"usuario": 1,
"longitudAnimal": "123.345"
}
【问题讨论】:
-
创建
WANT格式的新类 -
这可能对你有帮助.. baeldung.com/…
标签: json spring spring-boot spring-data-jpa