Commit f417ef3e authored by Zhuohao Li's avatar Zhuohao Li Committed by Jason Song

Fixed an issue with openapi item comment being too long (#2849)

parent 4ce3d70c
......@@ -60,6 +60,10 @@ public class ItemController {
throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!");
}
if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 64){
throw new BadRequestException("Comment length should not exceed 64 characters");
}
ItemDTO toCreate = OpenApiBeanUtils.transformToItemDTO(item);
//protect
......@@ -93,6 +97,10 @@ public class ItemController {
throw new BadRequestException("user(dataChangeLastModifiedBy) not exists");
}
if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 64){
throw new BadRequestException("Comment length should not exceed 64 characters");
}
try {
ItemDTO toUpdateItem = itemService
.loadItem(Env.fromString(env), appId, clusterName, namespaceName, item.getKey());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment