{"record":{"id":"492a393968352cbb","repo":"larksuite/cli","slug":"s-must-be-at-most-d","errorCode":null,"errorMessage":"%s must be at most %d","messagePattern":"(.+?) must be at most (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_binder.go","lineNumber":447,"sourceCode":"\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:\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)","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_binder.go#L429-L465","documentation":"Typed integer shape validation: the supplied integer exceeds the field's declared maximum. Fires during JSON value validation of compiled Args fields.","triggerScenarios":"Passing page_size or batch size above the API limit (e.g. 500 where max is 100); an ID or timestamp exceeding an allowed range; unbounded user input mapped to a capped field.","commonSituations":"User-supplied sizes without clamping; defaults from other APIs with higher limits; accumulating values (timeouts in seconds) that grew past the cap.","solutions":["Lower the value to at most the maximum shown in the error message","Clamp before the call: if v > max { v = max } or chunk the work into multiple calls","If the intent is 'as much as possible', query `schema` for the max and use it","Validate user input at the entry point of your script"],"exampleFix":"// before\npageSize := 1000\n// after\nconst maxPageSize = 100\nif pageSize > maxPageSize {\n    pageSize = maxPageSize\n}","handlingStrategy":"validation","validationCode":"func clampMax(v int, max int) int {\n    if v > max {\n        return max\n    }\n    return v\n} // or chunk requests when a single capped value is insufficient","typeGuard":"func isWithinMax(v int, max int) bool { return v <= max }","tryCatchPattern":"if err := bind(field, n); err != nil {\n    if strings.Contains(err.Error(), \"must be at most\") {\n        return fmt.Errorf(\"field %s exceeds maximum; cap or split the request: %w\", field, err)\n    }\n    return err\n}","preventionTips":["Cap user-supplied sizes at the schema maximum before binding","Paginate/split work instead of exceeding batch-size limits","Read the exact limit from `schema` rather than hardcoding guesses","Validate that defaults imported from other systems respect this API's caps"],"tags":["validation","cli","range-check","integer"],"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"}