Skip to content

角色权限修改时如果属性为null则服务器会返回 code=500 系统错误 #174

@ForteScarlet

Description

@ForteScarlet

如何复现问题?

请给出api接口,并给出相应的调用步骤

POST https://www.kookapp.cn/api/v3/guild-role/update
Authorization: Bot xxx
Content-Type: application/json

{
   "guild_id": "xxx",
   "role_id": "xxx",
   "name": "name",
   "color": null
}

上述请求中,如果去除 "color": null 则可以正常修改角色名称,如果携带则会得到如下500错误:

{"code":500,"message":"系统错误","data":{"name":"Internal Server Error","status":500}}

可以通过调整序列化工具的配置忽略null值的输出来解决,但是个人认为对于 null 值的属性服务器应当有所处理。
暂时不确定其他API是否有类似问题。

其它信息

Q A
你使用的语言 Kotlin
你的操作系统 MacOS

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions