{"record":{"id":"b639ff7a27249cfa","repo":"larksuite/cli","slug":"unsupported-public-shape-t","errorCode":null,"errorMessage":"unsupported public shape %T","messagePattern":"unsupported public shape %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_shape.go","lineNumber":135,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn typedObjectShape{\n\t\t\tFields: fields, AdditionalProperties: value.AdditionalProperties,\n\t\t\tAdditionalPropertiesShape: additional,\n\t\t}, nil\n\tcase command.OneOfShape:\n\t\tvariants := make([]typedValueShape, len(value.Variants))\n\t\tfor index, variant := range value.Variants {\n\t\t\tlowered, err := lowerAuthoringShape(variant)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"variant %d: %w\", index, err)\n\t\t\t}\n\t\t\tvariants[index] = lowered\n\t\t}\n\t\treturn typedOneOfShape{Variants: variants}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported public shape %T\", shape)\n\t}\n}\n","sourceCodeStart":117,"sourceCodeEnd":138,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_shape.go#L117-L138","documentation":"lowerAuthoringShape only accepts the documented public shape variants (String, Boolean, Integer, Number, Null, Const, Array, Object, OneOf); any other concrete type passed as a command.ValueShape hits the default branch. The error includes the offending Go type via %T so the developer can identify what was wrongly supplied.","triggerScenarios":"Passing a custom struct, pointer (*command.StringShape), map, or type from another package as Shape / Items / AdditionalPropertiesShape / Variants / field.Shape in a Typed input definition; a typed-nil interface (e.g. (*command.StringShape)(nil)) also lands here since its dynamic type is unmatched.","commonSituations":"Copy-pasting shape code from a different CLI version where shape types changed; building shapes dynamically with reflection or JSON-decoding them into map[string]interface{}; wrapping shapes in helper types.","solutions":["Read the %T in the error and replace that value with one of the supported command.*Shape types.","Never pass pointers to shape types — pass concrete values (command.StringShape{}, not &command.StringShape{}).","If shapes come from decoded data, add an explicit conversion step mapping decoded values to supported shape types before compiling."],"exampleFix":"// before\nShape: &command.StringShape{} // pointer: dynamic type *command.StringShape is unsupported\n// after\nShape: command.StringShape{}","handlingStrategy":"type-guard","validationCode":"if !isSupportedShape(myShape) {\n    return fmt.Errorf(\"unsupported shape %T; use a documented command.*Shape value\", myShape)\n}","typeGuard":"func isSupportedShape(s command.ValueShape) bool {\n    switch s.(type) {\n    case nil, command.StringShape, command.BooleanShape, command.IntegerShape,\n        command.NumberShape, command.NullShape, command.ConstShape,\n        command.ArrayShape, command.ObjectShape, command.OneOfShape:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Never pass &Shape pointers or map/interface{} values where ValueShape is expected.","Centralize shape construction in helpers typed to return the concrete command.*Shape values.","Add a compile-time assertion test that lowers every shortcut's input definition."],"tags":["go","schema","typed-input","type-mismatch","shape-lowering"],"backgroundTag":"unsupported-shape-type","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"}