{"record":{"id":"f15bc9e74a433aad","repo":"larksuite/cli","slug":"replace-inline-requires-path","errorCode":null,"errorMessage":"replace_inline requires path","messagePattern":"replace_inline requires path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/mail/draft/model.go","lineNumber":334,"sourceCode":"\t\t\treturn fmt.Errorf(\"add_attachment requires path\")\n\t\t}\n\tcase \"remove_attachment\":\n\t\tif !op.Target.hasAnyKey() {\n\t\t\treturn fmt.Errorf(\"remove_attachment requires target with at least one of part_id, cid, or token\")\n\t\t}\n\tcase \"add_inline\":\n\t\tif strings.TrimSpace(op.Path) == \"\" {\n\t\t\treturn fmt.Errorf(\"add_inline requires path\")\n\t\t}\n\t\tif strings.TrimSpace(op.CID) == \"\" {\n\t\t\treturn fmt.Errorf(\"add_inline requires cid\")\n\t\t}\n\tcase \"replace_inline\":\n\t\tif !op.Target.hasKey() {\n\t\t\treturn fmt.Errorf(\"replace_inline requires target with at least one of part_id or cid\")\n\t\t}\n\t\tif strings.TrimSpace(op.Path) == \"\" {\n\t\t\treturn fmt.Errorf(\"replace_inline requires path\")\n\t\t}\n\tcase \"remove_inline\":\n\t\tif !op.Target.hasKey() {\n\t\t\treturn fmt.Errorf(\"remove_inline requires target with at least one of part_id or cid\")\n\t\t}\n\tcase \"insert_signature\":\n\t\tif strings.TrimSpace(op.SignatureID) == \"\" {\n\t\t\treturn fmt.Errorf(\"insert_signature requires signature_id\")\n\t\t}\n\tcase \"remove_signature\":\n\t\t// No required fields.\n\tcase \"set_calendar\":\n\t\tif strings.TrimSpace(op.EventSummary) == \"\" {\n\t\t\treturn fmt.Errorf(\"set_calendar requires event_summary\")\n\t\t}\n\t\tif strings.TrimSpace(op.EventStart) == \"\" || strings.TrimSpace(op.EventEnd) == \"\" {\n\t\t\treturn fmt.Errorf(\"set_calendar requires event_start and event_end\")\n\t\t}","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/mail/draft/model.go#L316-L352","documentation":"Guard in PatchOp.Validate: a replace_inline op lacks a target key (part_id or cid), so the inline part to replace cannot be located.","triggerScenarios":"Thrown at shortcuts/mail/draft/model.go:334 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set target.part_id or target.cid"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}