larksuite/cli · error
description is declared by both doc and DataField.Descriptio
Error message
description is declared by both doc and DataField.Description
What it means
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.
Source
Thrown at shortcuts/common/typed_compile_data.go:354
}
func applyDataOverride(root *typedObjectShape, override typedDataField) error {
encodedParts := strings.Split(strings.TrimPrefix(override.Path, "/"), "/")
if len(encodedParts) == 0 || encodedParts[0] == "" {
return fmt.Errorf("pointer must identify a field")
}
parts := make([]string, len(encodedParts))
for i, encoded := range encodedParts {
decoded, ok := decodeJSONPointerSegment(encoded)
if !ok {
return fmt.Errorf("segment %q has invalid RFC 6901 escaping", encoded)
}
parts[i] = decoded
}
return mutateObjectField(root, parts, func(field *typedValueField) error {
if override.Description != "" {
if field.Description != "" {
return fmt.Errorf("description is declared by both doc and DataField.Description")
}
field.Description = strings.TrimSpace(override.Description)
}
if override.Shape != nil {
if shapeHasConstraints(field.Shape) {
return fmt.Errorf("Shape conflicts with schema constraints")
}
shape, err := lowerAuthoringShape(override.Shape)
if err != nil {
return err
}
if err := validateShape(shape, "DataField.Shape"); err != nil {
return err
}
field.Shape = shape
}
return nil
})View on GitHub (pinned to 7fd6ef3c07)
Solutions
- Provide the description in exactly one place: the doc tag or DataField.Description
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at shortcuts/common/typed_compile_data.go:354 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/91465be79f6e9e73.
Report an issue: GitHub.