{"record":{"id":"fa296ac731bf5205","repo":"larksuite/cli","slug":"output-data-shape-and-output-data-overrides-are-mu","errorCode":null,"errorMessage":"Output.Data.Shape and Output.Data.Overrides are mutually exclusive","messagePattern":"Output\\.Data\\.Shape and Output\\.Data\\.Overrides are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_data.go","lineNumber":25,"sourceCode":"import (\n\t\"encoding\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"math\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tjsonRawMessageType = reflect.TypeFor[json.RawMessage]()\n\tjsonMarshalerType  = reflect.TypeFor[json.Marshaler]()\n\ttextMarshalerType  = reflect.TypeFor[encoding.TextMarshaler]()\n)\n\nfunc compileData(dataType reflect.Type, definition typedDataDefinition) (typedValueShape, error) {\n\tif definition.Shape != nil && len(definition.Overrides) > 0 {\n\t\treturn nil, fmt.Errorf(\"Output.Data.Shape and Output.Data.Overrides are mutually exclusive\")\n\t}\n\tif definition.Shape != nil {\n\t\tshape, err := lowerAuthoringShape(definition.Shape)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := validateShape(shape, \"Output.Data.Shape\"); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn shape, nil\n\t}\n\tif dataType.Kind() == reflect.Interface && dataType.NumMethod() == 0 {\n\t\tif len(definition.Overrides) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"Output.Data.Overrides require struct Data\")\n\t\t}\n\t\treturn anyJSONShape{}, nil\n\t}\n\tif dataType.Kind() != reflect.Struct {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_data.go#L7-L43","documentation":"Compile-time guard in compileData: a definition supplies both an explicit Output.Data.Shape and Data.Overrides. Overrides mutate a compiled struct shape, so they cannot coexist with a fully explicit shape.","triggerScenarios":"Thrown at shortcuts/common/typed_compile_data.go:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep either Output.Data.Shape or Output.Data.Overrides, not both"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func (d typedDataDefinition) validate() error {\n  if d.Shape != nil && len(d.Overrides) > 0 {\n    return errors.New(\"Shape and Overrides are mutually exclusive\")\n  }\n  return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose one authoring style per output definition and document it","When migrating to explicit Shape, delete old Overrides in the same change","Add a lint/test asserting definitions never set both fields"],"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"}