Skip to content

Commit f9b17e1

Browse files
authored
fix(ai): Fix update agent card failed by console. (#13948)
Change-Id: Id32b8127a4eff96eb49475ca0b2ee9355fb1ac17
1 parent 699a720 commit f9b17e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ai/src/main/java/com/alibaba/nacos/ai/form/a2a/admin/AgentCardUpdateForm.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
package com.alibaba.nacos.ai.form.a2a.admin;
1818

19+
import com.alibaba.nacos.api.exception.api.NacosApiException;
20+
import com.alibaba.nacos.common.utils.StringUtils;
21+
1922
import java.io.Serial;
2023

2124
/**
@@ -42,4 +45,13 @@ public void setSetAsLatest(boolean setAsLatest) {
4245
protected void fillDefaultRegistrationType() {
4346
// Update does not need to fill registration type
4447
}
48+
49+
@Override
50+
protected void validateRegistrationType() throws NacosApiException {
51+
// Update request if no set registration type, means not change the registration type
52+
if (StringUtils.isEmpty(getRegistrationType())) {
53+
return;
54+
}
55+
super.validateRegistrationType();
56+
}
4557
}

0 commit comments

Comments
 (0)