{"record":{"id":"9f667cdb23c3877b","repo":"larksuite/cli","slug":"s-has-an-unsupported-integer-value","errorCode":null,"errorMessage":"%s has an unsupported integer value","messagePattern":"(.+?) has an unsupported integer value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_binder.go","lineNumber":450,"sourceCode":"\t\t\treturn fmt.Errorf(\"%s must be a boolean\", path)\n\t\t}\n\t\tif len(constraint.Enum) > 0 && !slices.Contains(constraint.Enum, boolean) {\n\t\t\treturn fmt.Errorf(\"%s has an unsupported boolean value\", path)\n\t\t}\n\t\treturn nil\n\tcase typedIntegerShape:\n\t\tnumber, ok := validationInteger(value)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"%s must be an integer\", path)\n\t\t}\n\t\tif constraint.Minimum != nil && number < *constraint.Minimum {\n\t\t\treturn fmt.Errorf(\"%s must be at least %d\", path, *constraint.Minimum)\n\t\t}\n\t\tif constraint.Maximum != nil && number > *constraint.Maximum {\n\t\t\treturn fmt.Errorf(\"%s must be at most %d\", path, *constraint.Maximum)\n\t\t}\n\t\tif len(constraint.Enum) > 0 && !slices.Contains(constraint.Enum, number) {\n\t\t\treturn fmt.Errorf(\"%s has an unsupported integer value\", path)\n\t\t}\n\t\treturn nil\n\tcase typedNumberShape:\n\t\tnumber, ok := validationNumber(value)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"%s must be a number\", path)\n\t\t}\n\t\tif len(constraint.Enum) > 0 && !slices.Contains(constraint.Enum, number) {\n\t\t\treturn fmt.Errorf(\"%s has an unsupported number value\", path)\n\t\t}\n\t\tif constraint.Minimum != nil && number < *constraint.Minimum {\n\t\t\treturn fmt.Errorf(\"%s must be at least %v\", path, *constraint.Minimum)\n\t\t}\n\t\tif constraint.Maximum != nil && number > *constraint.Maximum {\n\t\t\treturn fmt.Errorf(\"%s must be at most %v\", path, *constraint.Maximum)\n\t\t}\n\t\treturn nil\n\tcase typedArrayShape:","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_binder.go#L432-L468","documentation":"The value is an acceptable integer but is not a member of the field's integer enum (constraint.Enum). This is a value-set rejection, not a range or type issue: the schema restricts the field to specific discrete values (e.g. only 1, 2, 4 for a size selector).","triggerScenarios":"Passing 3 where the schema enum is [1,2,4]; using an arbitrary count for a field that models fixed tiers; IDs encoded as enum-like integers validated through validateCompiledValue/valueCompatibleWithShape.","commonSituations":"Choosing sizes/multipliers not in the supported tier list; guessing numeric option codes instead of looking them up; API version differences changing the allowed set.","solutions":["Pick one of the supported values (see `schema` for the enum list)","Map user input to the nearest allowed tier before the call","If a formerly accepted value fails, refresh the CLI catalog metadata","Do not round to an arbitrary nearby value — only listed values pass"],"exampleFix":"// before\nsize := 3\n// after\nallowed := []int{1, 2, 4}\nslices.Sort(allowed)\ni, _ := slices.BinarySearch(allowed, size)\nif i == len(allowed) { i = len(allowed)-1 }\nsize = allowed[i]","handlingStrategy":"validation","validationCode":"func snapToEnum(v int, allowed []int) (int, error) {\n    if slices.Contains(allowed, v) {\n        return v, nil\n    }\n    return 0, fmt.Errorf(\"%d not in allowed set %v\", v, allowed)\n}","typeGuard":"func isAllowedInt(v any, allowed ...int) bool {\n    n, ok := v.(int)\n    return ok && slices.Contains(allowed, n)\n}","tryCatchPattern":"if err := bind(field, n); err != nil {\n    if strings.Contains(err.Error(), \"unsupported integer value\") {\n        return fmt.Errorf(\"field %s accepts only specific values; see `lark ... schema`: %w\", field, err)\n    }\n    return err\n}","preventionTips":["Map user input onto the documented tier list instead of passing raw numbers","Keep the accepted integer set as constants mirroring `schema` output","Refresh CLI catalog metadata if the accepted set appears to have changed"],"tags":["validation","cli","enum","integer"],"backgroundTag":"invalid-enum-value","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"}