{"record":{"id":"91465be79f6e9e73","repo":"larksuite/cli","slug":"description-is-declared-by-both-doc-and-datafield","errorCode":null,"errorMessage":"description is declared by both doc and DataField.Description","messagePattern":"description is declared by both doc and DataField\\.Description","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_data.go","lineNumber":354,"sourceCode":"}\n\nfunc applyDataOverride(root *typedObjectShape, override typedDataField) error {\n\tencodedParts := strings.Split(strings.TrimPrefix(override.Path, \"/\"), \"/\")\n\tif len(encodedParts) == 0 || encodedParts[0] == \"\" {\n\t\treturn fmt.Errorf(\"pointer must identify a field\")\n\t}\n\tparts := make([]string, len(encodedParts))\n\tfor i, encoded := range encodedParts {\n\t\tdecoded, ok := decodeJSONPointerSegment(encoded)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"segment %q has invalid RFC 6901 escaping\", encoded)\n\t\t}\n\t\tparts[i] = decoded\n\t}\n\treturn mutateObjectField(root, parts, func(field *typedValueField) error {\n\t\tif override.Description != \"\" {\n\t\t\tif field.Description != \"\" {\n\t\t\t\treturn fmt.Errorf(\"description is declared by both doc and DataField.Description\")\n\t\t\t}\n\t\t\tfield.Description = strings.TrimSpace(override.Description)\n\t\t}\n\t\tif override.Shape != nil {\n\t\t\tif shapeHasConstraints(field.Shape) {\n\t\t\t\treturn fmt.Errorf(\"Shape conflicts with schema constraints\")\n\t\t\t}\n\t\t\tshape, err := lowerAuthoringShape(override.Shape)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := validateShape(shape, \"DataField.Shape\"); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfield.Shape = shape\n\t\t}\n\t\treturn nil\n\t})","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_data.go#L336-L372","documentation":"Guard in applyDataOverride: the targeted Data field already declares a description via its doc tag, and the override also sets Description; only one source may define it.","triggerScenarios":"Thrown at shortcuts/common/typed_compile_data.go:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the description in exactly one place: the doc tag or DataField.Description"],"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"}