alibaba/nacos · warning · NacosApiException
PARAMETER_VALIDATE_ERROR
PARAMETER_VALIDATE_ERROR
Error message
skillCard name must match skillName parameter
What it means
SkillDraftCreateForm.parseInitialSkillOrNull() (called by prepareCreateDraftRequest) parses the skillCard JSON and, if the request also carries a top-level `skillName`, requires that the two names be exactly equal. Mismatched names are rejected with PARAMETER_VALIDATE_ERROR to prevent ambiguity about which skill a draft belongs to. The comparison is exact (case-sensitive) using String.equals.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillDraftCreateForm.java:125
public void setTargetVersion(String targetVersion) {
this.targetVersion = targetVersion;
}
public String getCommitMsg() {
return commitMsg;
}
public void setCommitMsg(String commitMsg) {
this.commitMsg = commitMsg;
}
private Skill parseInitialSkillOrNull() throws NacosApiException {
if (StringUtils.isBlank(getSkillCard())) {
return null;
}
Skill skill = SkillRequestUtil.parseSkill(this);
if (StringUtils.isNotBlank(getSkillName()) && !getSkillName().equals(skill.getName())) {
throw new NacosApiException(NacosException.INVALID_PARAM,
ErrorCode.PARAMETER_VALIDATE_ERROR,
"skillCard name must match skillName parameter");
}
return skill;
}
private String requireResolvedSkillName(Skill initialOrNull) throws NacosApiException {
String skillName = StringUtils.isNotBlank(getSkillName()) ? getSkillName()
: (initialOrNull != null ? initialOrNull.getName() : null);
if (StringUtils.isBlank(skillName)) {
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
"skillName or skillCard with name is required");
}
return skillName;
}
}
View on GitHub (pinned to 9b989acdf1)
Solutions
- Make skillName and skillCard.name exactly identical (same case) before sending.
- Omit the top-level skillName entirely and let the server read the name from the card.
- Re-derive skillName from the edited card object right before serialization.
Example fix
// before
{"skillName":"my-skill","skillCard":"{\"name\":\"my-skill-v2\",...}"}
// after
{"skillName":"my-skill-v2","skillCard":"{\"name\":\"my-skill-v2\",...}"} Defensive patterns
Strategy: validation
Validate before calling
// Ensure skillName and card name agree before sending
Skill parsed = SkillRequestUtil.parseSkill(form);
if (form.getSkillName() != null && !form.getSkillName().isBlank()
&& !form.getSkillName().equals(parsed.getName())) {
throw new IllegalArgumentException("skillName must equal skillCard.name");
} Type guard
// TypeScript
const namesAgree = (skillName: string, card: string): boolean => {
try { return JSON.parse(card).name === skillName; } catch { return false; }
}; Try / catch
try {
form.prepareCreateDraftRequest(); // runs parseInitialSkillOrNull
} catch (NacosApiException e) {
// names mismatch — sync skillName from the card editor
} Prevention
- Derive the top-level skillName from the card object right before serialize; don't keep two editable copies.
- Omit top-level skillName and let the server read it from the card.
- Watch for case differences — the check is case-sensitive.
When it happens
Trigger: Sending create-draft with BOTH a `skillName` parameter AND a `skillCard` whose inner `name` field differs — e.g. skillName="my-skill" but skillCard.name="my-skill-v2". Only triggered when both are present and non-blank.
Common situations: Frontend pre-filling skillName from an old value while the user edited the name inside the card editor; copy-pasting a skillCard from another skill without updating the top-level skillName; case differences ("MySkill" vs "myskill") since the check is case-sensitive.
Related errors
- PARAMETER_MISSING
- PARAMETER_VALIDATE_ERROR
- PARAMETER_VALIDATE_ERROR
- PARAMETER_VALIDATE_ERROR
- PARAMETER_VALIDATE_ERROR
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/caecc0335d0c4855.
Report an issue: GitHub.