{"record":{"id":"ada4f2df341e7170","repo":"larksuite/cli","slug":"s-must-be-at-least-v","errorCode":null,"errorMessage":"%s must be at least %v","messagePattern":"(.+?) must be at least (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_binder.go","lineNumber":462,"sourceCode":"\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:\n\t\titems, ok := value.([]any)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"%s must be an array\", path)\n\t\t}\n\t\tif constraint.MinItems != nil && len(items) < *constraint.MinItems {\n\t\t\treturn fmt.Errorf(\"%s must contain at least %d items\", path, *constraint.MinItems)\n\t\t}\n\t\tif constraint.MaxItems != nil && len(items) > *constraint.MaxItems {\n\t\t\treturn fmt.Errorf(\"%s must contain at most %d items\", path, *constraint.MaxItems)\n\t\t}\n\t\tfor i, item := range items {\n\t\t\tif err := validateJSONValueAgainstShape(item, constraint.Items, fmt.Sprintf(\"%s[%d]\", path, i)); err != nil {","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_binder.go#L444-L480","documentation":"This is a typed-flag shape validation error from the lark-cli shortcut binder. When a shortcut field is declared with a number shape carrying a minimum constraint, any supplied numeric value below that minimum is rejected before any API call is made. The message names the failing field path and the required lower bound.","triggerScenarios":"Calling a shortcut/typed command with a numeric flag (or a JSON value validated against a compiled shape) whose value is less than the shape's declared Minimum — e.g. --count=0 when the shape requires >= 1.","commonSituations":"Off-by-one defaults, passing 0 or negative values where the Lark API requires a positive number, copying example payloads with out-of-range sizes (page_size, limit), or unit confusion (minutes vs seconds).","solutions":["Read the bound in the message and supply a value >= that minimum.","Check the command's --help or schema output for the documented range of the field.","If the value comes from config/CLI input, clamp or validate it before invoking the command.","If you believe the minimum is wrong, check the upstream OpenAPI field constraint; the shape is generated from metadata."],"exampleFix":"// before\nlark-cli shortcut demo --page-size 0\n// error: page_size must be at least 1\n\n// after\nlark-cli shortcut demo --page-size 10","handlingStrategy":"validation","validationCode":"const minCount = 1\nif pageSize < minCount {\n    return fmt.Errorf(\"page_size must be at least %d\", minCount)\n}\n// proceed with the command invocation","typeGuard":"func inRangeInt(v, min, max int64) bool { return v >= min && v <= max }","tryCatchPattern":null,"preventionTips":["Check --help/schema for declared min/max before scripting a command.","Clamp user/config-supplied numbers to documented ranges before invocation.","Add a shell precondition test ([ \"$N\" -ge 1 ]) around numeric flags.","Prefer pagination over extreme page_size values."],"tags":["validation","cli","numeric-range"],"backgroundTag":"schema-validation-failed","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"}