alibaba/nacos · error · NacosApiException
PARAMETER_MISSING
PARAMETER_MISSING
Error message
Request parameter `skillCard` should not be `null` or empty.
What it means
SkillDetailForm.validate() requires a non-empty `skillCard` JSON string for create/detail operations. The skillCard carries the complete Skill object (name, description, content, etc.); without it the server has nothing to create or show. Unlike SkillForm, skillName is OPTIONAL here because the name can live inside the skillCard itself. The check uses StringUtils.isEmpty, so null or empty-string both fail.
Source
Thrown at ai/src/main/java/com/alibaba/nacos/ai/form/skills/admin/SkillDetailForm.java:47
* @author nacos
*/
public class SkillDetailForm extends SkillForm {
@Serial
private static final long serialVersionUID = 1L;
/**
* Skill card JSON string, contains complete Skill information.
*/
private String skillCard;
@Override
public void validate() throws NacosApiException {
fillDefaultNamespaceId();
// For create/detail, skillName is optional (can be in skillCard)
// Only skillCard is required
if (StringUtils.isEmpty(skillCard)) {
throw new NacosApiException(NacosException.INVALID_PARAM, ErrorCode.PARAMETER_MISSING,
"Request parameter `skillCard` should not be `null` or empty.");
}
}
public String getSkillCard() {
return skillCard;
}
public void setSkillCard(String skillCard) {
this.skillCard = skillCard;
}
}
View on GitHub (pinned to 9b989acdf1)
Solutions
- Assemble the full Skill object and serialize it to the `skillCard` field as a JSON string.
- Ensure the Skill object has at least a `name`; the name may also be read from the card.
- If forking from an existing version instead of creating new, use SkillDraftCreateForm with basedOnVersion (which does NOT require skillCard).
Example fix
// before
{"skillName":"my-skill"}
// after
{"skillCard":"{\"name\":\"my-skill\",\"description\":\"...\",\"content\":\"...\"}"} Defensive patterns
Strategy: validation
Validate before calling
// Before calling skill create/detail-submit
if (skillCard == null || skillCard.isEmpty()) {
throw new IllegalArgumentException("skillCard JSON is required");
}
// also ensure the card parses and has a name
Skill parsed = SkillRequestUtil.parseSkill(form);
if (parsed.getName() == null || parsed.getName().isBlank()) {
throw new IllegalArgumentException("skillCard must contain a name");
} Type guard
// TypeScript — assemble card client-side
const buildSkillCard = (s: { name: string; content: string }): string =>
JSON.stringify(s);
const isValidCard = (json: string): boolean => {
try { const o = JSON.parse(json); return !!o?.name; } catch { return false; }
}; Try / catch
try {
form.validate();
} catch (NacosApiException e) {
// skillCard missing — assemble the full Skill JSON and retry
} Prevention
- Assemble the entire Skill object into skillCard JSON; do not send scattered fields.
- If forking, switch to SkillDraftCreateForm with basedOnVersion (no skillCard needed).
- Validate the card has a non-blank name before serializing.
When it happens
Trigger: Calling the skill create or detail-submit API without the `skillCard` field, or with skillCard="". Triggered when the client sends skillName separately but no card body.
Common situations: Frontend that splits skill fields into individual form params instead of assembling the skillCard JSON; sending the card under a different field name (e.g. `skill`, `payload`); JSON serialization producing an empty string due to a null object.
Related errors
AI-assisted analysis of alibaba/nacos@9b989acdf1 (2026-08-14).
Data as JSON: /api/errors/da74c0138f3cdf8d.
Report an issue: GitHub.