flipped-aurora/gin-vue-admin · error

模块 %d 的 description 不能为空

Error message

模块 %d 的 description 不能为空

What it means

validateExecutionPlan requires every module in the execution plan to carry a non-empty Description. The description is written into generated code comments and API/Swagger documentation, so the generator refuses to proceed when it is missing. This check fires in Handle before any generation side effects.

Source

Thrown at server/mcp/gva_execute.go:335

	}

	if plan.NeedCreatedModules {
		if len(plan.ModulesInfo) == 0 {
			return errors.New("当 needCreatedModules=true 时,modulesInfo 不能为空")
		}

		for moduleIndex, moduleInfo := range plan.ModulesInfo {
			if moduleInfo.Package == "" {
				return fmt.Errorf("模块 %d 的 package 不能为空", moduleIndex+1)
			}
			if moduleInfo.StructName == "" {
				return fmt.Errorf("模块 %d 的 structName 不能为空", moduleIndex+1)
			}
			if moduleInfo.TableName == "" {
				return fmt.Errorf("模块 %d 的 tableName 不能为空", moduleIndex+1)
			}
			if moduleInfo.Description == "" {
				return fmt.Errorf("模块 %d 的 description 不能为空", moduleIndex+1)
			}
			if moduleInfo.Abbreviation == "" {
				return fmt.Errorf("模块 %d 的 abbreviation 不能为空", moduleIndex+1)
			}
			if moduleInfo.PackageName == "" {
				return fmt.Errorf("模块 %d 的 packageName 不能为空", moduleIndex+1)
			}
			if moduleInfo.HumpPackageName == "" {
				return fmt.Errorf("模块 %d 的 humpPackageName 不能为空", moduleIndex+1)
			}
			if len(moduleInfo.Fields) == 0 {
				return fmt.Errorf("模块 %d 的 fields 不能为空,至少需要一个字段", moduleIndex+1)
			}

			for i, field := range moduleInfo.Fields {
				if field.FieldName == "" {
					return fmt.Errorf("模块 %d 字段 %d 的 fieldName 不能为空", moduleIndex+1, i+1)
				}

View on GitHub (pinned to 3136500ef3)

Solutions

  1. Add a concise Chinese/English description string to each module entry
  2. Describe the module's business purpose (it lands in generated comments and Swagger docs)
  3. Re-run the tool; note validation is sequential, so fix errors one at a time if several fields are missing

Example fix

// before
{"modules":[{"packageName":"article","structName":"Article","tableName":"article"}]}
// after
{"modules":[{"packageName":"article","structName":"Article","tableName":"article","description":"article management"}]}
Defensive patterns

Strategy: validation

Validate before calling

for i, m := range plan.Modules {
  if strings.TrimSpace(m.Description) == "" {
    return fmt.Errorf("modules[%d].description is required", i)
  }
}

Type guard

func hasDescription(m Module) bool { return strings.TrimSpace(m.Description) != "" }

Prevention

When it happens

Trigger: Submitting an execution plan via the MCP gva_execute tool where modules[i].description is absent, null, or "" while all other required keys are present.

Common situations: Minimal LLM-authored plans that omit descriptive metadata; plans copied from examples with descriptions stripped; batch generation scripts that fill only technical fields.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31). Data as JSON: /api/errors/b174893a74728acf. Report an issue: GitHub.