APIJSON [Bug] 别名在数组的情况下失效并会导致Response返回非数组

ssm49v7z  于 3个月前  发布在  其他
关注(0)|答案(2)|浏览(67)

APIJSON Version/APIJSON 版本号

6.2.0

Database Type & Version/数据库类型及版本号

Mysql 5.7

Environment/环境信息

- JDK/基础库: 1.8.0_17
- OS/系统: Windows 11

APIAuto Screenshots/APIAuto 请求与结果完整截屏

https://github.com/watson-song/sshcrab/blob/watson-song-patch-1/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230917233357.png

Current Behavior/问题描述

在查询数组的情况下使用别名失效,但却主要在根节点是数组的情况下才失效,在非根节点是可以的,详见截图

请求URL:/get
请求body:{
    "ClassRoom[]:data": {
        "ClassRoom": {},
        "count": 8,
        "page": 0 
    },
    "format": true,
    "@explain": false
}

返回:
{
"data":  {
"classRoom":  {
"id": 1 ,
"name": "ClassRoom#1" ,
"address": "room1" ,
"area": 20 ,
"remark": "rm1"
},
"count": 8 ,
"page": 0
},
"ok": true ,
"code": 200 ,
"msg": "success" 
}

Expected Behavior/期望结果

应该返回:
{
"data":  [
 {
"id": 1 ,
"name": "ClassRoom#1" ,
"address": "room1" ,
"area": 20 ,
"remark": "rm1"
},
 {
"id": 2 ,
"name": "ClassRoom#2" ,
"address": "room2" ,
"area": 20 ,
"remark": "rm2"
}
],
"ok": true ,
"code": 200 ,
"msg": "success" 
}

Any additional comments?/其它补充说明?

No response

相关问题