diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java index fdc9f0e18e8..f8c0f90a67b 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java @@ -123,6 +123,9 @@ public void updateItem(@PathVariable String appId, @PathVariable String env, } if (createIfNotExists) { + if (StringUtils.isEmpty(item.getDataChangeCreatedBy())) { + throw new BadRequestException("dataChangeCreatedBy is required when createIfNotExists is true"); + } this.itemOpenApiService.createOrUpdateItem(appId, env, clusterName, namespaceName, item); } else { this.itemOpenApiService.updateItem(appId, env, clusterName, namespaceName, item);