{"record":{"id":"a2744be796da5bd3","repo":"larksuite/cli","slug":"s-must-be-at-most-v","errorCode":null,"errorMessage":"%s must be at most %v","messagePattern":"(.+?) must be at most (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_binder.go","lineNumber":465,"sourceCode":"\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 {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_binder.go#L447-L483","documentation":"Typed number shape validation: a numeric value exceeds the field's declared maximum (floating-point variant). Part of validateJSONValueAgainstShape for number-typed fields.","triggerScenarios":"Passing a numeric flag/JSON value greater than the shape's Maximum, e.g. --page-size 100 when the shape allows at most 50.","commonSituations":"Assuming an API accepts large page sizes or limits, migrating from another API with higher caps, or computing values (counts, timeouts) that overflow the declared range.","solutions":["Lower the value to at most the bound shown in the message.","Run --help or schema for the command to see the allowed range.","If you need more items, paginate with page_token instead of raising page_size.","Verify the constraint in the upstream OpenAPI metadata if you think the cap is stale."],"exampleFix":"// before\nlark-cli shortcut demo --page-size 500\n// error: page_size must be at most 50\n\n// after\nlark-cli shortcut demo --page-size 50","handlingStrategy":"validation","validationCode":"const maxSize = 50\nif pageSize > maxSize {\n    return fmt.Errorf(\"page_size must be at most %d\", maxSize)\n}\n// proceed with the command invocation","typeGuard":"func inRangeInt(v, min, max int64) bool { return v >= min && v <= max }","tryCatchPattern":null,"preventionTips":["Look up the documented maximum in --help/schema before calling.","Chunk work instead of inflating limit/page_size values.","Never copy limits from other APIs without checking this CLI's schema.","Handle pagination tokens rather than oversized pages."],"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"}