{"record":{"id":"23b516681ac01019","repo":"larksuite/cli","slug":"s-has-an-unsupported-boolean-value","errorCode":null,"errorMessage":"%s has an unsupported boolean value","messagePattern":"(.+?) has an unsupported boolean value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_binder.go","lineNumber":435,"sourceCode":"\t\t}\n\t\tlength := len([]rune(text))\n\t\tif constraint.MinLength != nil && length < *constraint.MinLength {\n\t\t\treturn fmt.Errorf(\"%s must contain at least %d characters\", path, *constraint.MinLength)\n\t\t}\n\t\tif constraint.MaxLength != nil && length > *constraint.MaxLength {\n\t\t\treturn fmt.Errorf(\"%s must contain at most %d characters\", path, *constraint.MaxLength)\n\t\t}\n\t\tif len(constraint.Enum) > 0 && !slices.Contains(constraint.Enum, text) {\n\t\t\treturn fmt.Errorf(\"%s must be one of: %s\", path, strings.Join(constraint.Enum, \", \"))\n\t\t}\n\t\treturn nil\n\tcase typedBooleanShape:\n\t\tboolean, ok := value.(bool)\n\t\tif !ok {\n\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:","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_binder.go#L417-L453","documentation":"The value is a proper boolean but not one of the booleans the schema's enum permits (e.g. enum: [false] while true was supplied). The type check passed, so this is a value-level rejection by validateJSONValueAgainstShape. It typically occurs on fields constrained to exactly one boolean value.","triggerScenarios":"Setting a boolean field whose constraint.Enum is [false] (or [true]) to the opposite value; supplying `true` to a read-only/constant boolean flag in a nested object validated by valueCompatibleWithShape.","commonSituations":"Trying to flip a server-controlled boolean (e.g. a synthetic or derived field); copying request examples that set a constant flag; schema updates that pinned a previously free boolean.","solutions":["Set the boolean to the only value the schema allows (the message names the field; check `schema` for the enum)","Remove the field from the request if the API owns its value","If a previously working value now fails, refresh the CLI catalog/schema metadata","Do not attempt workarounds like 0/1 — the field is strictly boolean"],"exampleFix":"// before\nbody := map[string]any{\"shared\": true} // enum only allows false\n// after\nbody := map[string]any{} // omit the server-owned field","handlingStrategy":"validation","validationCode":"func ensureBoolEnum(v bool, allowed []bool) error {\n    if len(allowed) > 0 && !slices.Contains(allowed, v) {\n        return fmt.Errorf(\"boolean %v not allowed; must be %v\", v, allowed)\n    }\n    return nil\n}","typeGuard":"func isAllowedBool(v any, allowed ...bool) bool {\n    b, ok := v.(bool)\n    return ok && (len(allowed) == 0 || slices.Contains(allowed, b))\n}","tryCatchPattern":"if err := bind(field, true); err != nil {\n    if strings.Contains(err.Error(), \"unsupported boolean value\") {\n        return fmt.Errorf(\"field %s is fixed by the API; omit it or use the allowed value: %w\", field, err)\n    }\n    return err\n}","preventionTips":["Omit server-owned or constant boolean fields from requests","Consult `schema` before setting boolean fields with restricted values","Update CLI catalog metadata when previously accepted values are rejected"],"tags":["validation","cli","enum","boolean"],"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"}