{"record":{"id":"1b6266fe8429b679","repo":"larksuite/cli","slug":"s-uses-unsupported-shape-t","errorCode":null,"errorMessage":"%s uses unsupported shape %T","messagePattern":"(.+?) uses unsupported shape %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"shortcuts/common/typed_binder.go","lineNumber":518,"sourceCode":"\t\t\tfield, exists := fields[name]\n\t\t\tif !exists {\n\t\t\t\tif !constraint.AdditionalProperties {\n\t\t\t\t\treturn fmt.Errorf(\"%s contains unknown field %q\", path, name)\n\t\t\t\t}\n\t\t\t\tif constraint.AdditionalPropertiesShape != nil {\n\t\t\t\t\tif err := validateJSONValueAgainstShape(item, constraint.AdditionalPropertiesShape, path+\".\"+name); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := validateJSONValueAgainstShape(item, field.Shape, path+\".\"+name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"%s uses unsupported shape %T\", path, shape)\n\t}\n}\n\nfunc decodeJSONValidationValue(encoded []byte) (any, error) {\n\tdecoder := json.NewDecoder(bytes.NewReader(encoded))\n\tdecoder.UseNumber()\n\tvar value any\n\tif err := decoder.Decode(&value); err != nil {\n\t\treturn nil, err\n\t}\n\treturn value, nil\n}\n\nfunc validationInteger(value any) (int64, bool) {\n\tswitch number := value.(type) {\n\tcase json.Number:\n\t\tparsed, err := strconv.ParseInt(number.String(), 10, 64)\n\t\treturn parsed, err == nil","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_binder.go#L500-L536","documentation":"The shape definition itself has a kind the validator does not implement — this is an internal/programming error, not bad user input. The compiled command's shape reached the default branch of the type switch in validateJSONValueAgainstShape, meaning a shape type exists without a validation case.","triggerScenarios":"A developer adds a new typed*Shape kind to the binder but forgets a case in validateJSONValueAgainstShape; a mismatched/older binary compiled against newer shape metadata; extension code constructing a custom shape the built-in validator does not know.","commonSituations":"Version skew between the CLI binary and embedded service metadata; third-party extensions registering unsupported shapes; incomplete refactors of the typed-binder package.","solutions":["Upgrade lark-cli to a version whose binder supports the shape in use (version skew is the most common cause).","If you develop the shortcut/plugin, add a case for the new shape kind in validateJSONValueAgainstShape.","Report the exact path and shape type (%T in the message) as a bug if it occurs with stock commands."],"exampleFix":"// before (binder source)\ndefault:\n    return fmt.Errorf(\"%s uses unsupported shape %T\", path, shape)\n\n// after (add the missing case)\ncase typedNewShape:\n    // validation for the new shape kind\n    ...\n    return nil","handlingStrategy":"try-catch","validationCode":"if lark-cli --version | grep -qv \"$MIN_VERSION\"; then\n  echo \"upgrade lark-cli: binary/metadata version skew possible\" >&2\nfi","typeGuard":"func isUnsupportedShapeErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"uses unsupported shape\")\n}","tryCatchPattern":"out, err := cmd.CombinedOutput()\nif isUnsupportedShapeErr(errors.New(string(out))) {\n    // report bug / upgrade binary; no input change will fix it\n    fmt.Fprintln(os.Stderr, \"unsupported shape — upgrade lark-cli or report bug:\", string(out))\n    os.Exit(3)\n}","preventionTips":["Keep the CLI binary and embedded metadata versions in step (upgrade together).","When adding a shape kind, add its validation case and a test in the same PR.","Treat this error as a bug report trigger, not a user-input problem.","Pin and document the CLI version used by automation."],"tags":["internal","bug","shape-validation","version-skew"],"backgroundTag":"unsupported-schema-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"}