{"record":{"id":"b174893a74728acf","repo":"flipped-aurora/gin-vue-admin","slug":"d-description","errorCode":null,"errorMessage":"模块 %d 的 description 不能为空","messagePattern":"模块 (.+?) 的 description 不能为空","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/mcp/gva_execute.go","lineNumber":335,"sourceCode":"\t}\n\n\tif plan.NeedCreatedModules {\n\t\tif len(plan.ModulesInfo) == 0 {\n\t\t\treturn errors.New(\"当 needCreatedModules=true 时，modulesInfo 不能为空\")\n\t\t}\n\n\t\tfor moduleIndex, moduleInfo := range plan.ModulesInfo {\n\t\t\tif moduleInfo.Package == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 package 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.StructName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 structName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.TableName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 tableName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.Description == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 description 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.Abbreviation == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 abbreviation 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.PackageName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 packageName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif moduleInfo.HumpPackageName == \"\" {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 humpPackageName 不能为空\", moduleIndex+1)\n\t\t\t}\n\t\t\tif len(moduleInfo.Fields) == 0 {\n\t\t\t\treturn fmt.Errorf(\"模块 %d 的 fields 不能为空，至少需要一个字段\", moduleIndex+1)\n\t\t\t}\n\n\t\t\tfor i, field := range moduleInfo.Fields {\n\t\t\t\tif field.FieldName == \"\" {\n\t\t\t\t\treturn fmt.Errorf(\"模块 %d 字段 %d 的 fieldName 不能为空\", moduleIndex+1, i+1)\n\t\t\t\t}","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/flipped-aurora/gin-vue-admin/blob/3136500ef380842b0eb6c4daa87c3f8a47fcf9e0/server/mcp/gva_execute.go#L317-L353","documentation":"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.","triggerScenarios":"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.","commonSituations":"Minimal LLM-authored plans that omit descriptive metadata; plans copied from examples with descriptions stripped; batch generation scripts that fill only technical fields.","solutions":["Add a concise Chinese/English description string to each module entry","Describe the module's business purpose (it lands in generated comments and Swagger docs)","Re-run the tool; note validation is sequential, so fix errors one at a time if several fields are missing"],"exampleFix":"// before\n{\"modules\":[{\"packageName\":\"article\",\"structName\":\"Article\",\"tableName\":\"article\"}]}\n// after\n{\"modules\":[{\"packageName\":\"article\",\"structName\":\"Article\",\"tableName\":\"article\",\"description\":\"article management\"}]}","handlingStrategy":"validation","validationCode":"for i, m := range plan.Modules {\n  if strings.TrimSpace(m.Description) == \"\" {\n    return fmt.Errorf(\"modules[%d].description is required\", i)\n  }\n}","typeGuard":"func hasDescription(m Module) bool { return strings.TrimSpace(m.Description) != \"\" }","tryCatchPattern":null,"preventionTips":["Never hand-write plans without a description line per module","Default the description to structName + purpose if unsure","Lint plans for all required module keys before execution"],"tags":["mcp","code-generation","validation","config"],"backgroundTag":"missing-required-field","analyzedSha":"3136500ef380842b0eb6c4daa87c3f8a47fcf9e0","analyzedAt":"2026-08-31T13:50:02.721Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}