{"record":{"id":"4fbfd17c5b92d86f","repo":"larksuite/cli","slug":"svalue-v-is-below-minimum-v","errorCode":null,"errorMessage":"%svalue %v is below minimum %v","messagePattern":"(.+?)value (.+?) is below minimum (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/sheets/flag_schema_validate.go","lineNumber":375,"sourceCode":"\tif schema == nil || c.full() {\n\t\treturn\n\t}\n\tif value == nil && schema.Nullable {\n\t\treturn\n\t}\n\n\tif schema.Type != \"\" {\n\t\tif !matchesJSONType(value, schema.Type) {\n\t\t\tc.add(&typeMismatchError{path: path, expected: schema.Type, got: jsType(value), enum: schema.Enum, description: schema.Description})\n\t\t\treturn // wrong container type — descending would cascade nonsense.\n\t\t}\n\t}\n\n\t// Numeric bounds — only checked when value is a number (type mismatch\n\t// already reported above). Apply to both `number` and `integer` types.\n\tif num, ok := value.(float64); ok {\n\t\tif schema.Minimum != nil && num < *schema.Minimum {\n\t\t\tc.add(fmt.Errorf(\"%svalue %v is below minimum %v\", pathPrefix(path), num, *schema.Minimum)) //nolint:forbidigo // intermediate error; validateFlagAgainstSchema wraps it into a typed flag validation error with a --print-schema hint\n\t\t}\n\t\tif schema.Maximum != nil && num > *schema.Maximum {\n\t\t\tc.add(fmt.Errorf(\"%svalue %v is above maximum %v\", pathPrefix(path), num, *schema.Maximum)) //nolint:forbidigo // intermediate error; validateFlagAgainstSchema wraps it into a typed flag validation error with a --print-schema hint\n\t\t}\n\t}\n\n\t// Array length bounds — only checked when value is an array.\n\tif arr, ok := value.([]interface{}); ok {\n\t\tif schema.MinItems != nil && len(arr) < *schema.MinItems {\n\t\t\tc.add(fmt.Errorf(\"%sarray has %d items, minimum is %d\", pathPrefix(path), len(arr), *schema.MinItems)) //nolint:forbidigo // intermediate error; validateFlagAgainstSchema wraps it into a typed flag validation error with a --print-schema hint\n\t\t}\n\t\tif schema.MaxItems != nil && len(arr) > *schema.MaxItems {\n\t\t\tc.add(fmt.Errorf(\"%sarray has %d items, maximum is %d\", pathPrefix(path), len(arr), *schema.MaxItems)) //nolint:forbidigo // intermediate error; validateFlagAgainstSchema wraps it into a typed flag validation error with a --print-schema hint\n\t\t}\n\t}\n\n\tif len(schema.Enum) > 0 {\n\t\tmatched := false","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/sheets/flag_schema_validate.go#L357-L393","documentation":"Schema validation error raised by collectSchemaErrors in the sheets shortcut flag validator. When a flag value parsed as a number (float64) is smaller than the JSON-schema `minimum` bound declared for that field, the validator records this intermediate error. It is later wrapped into a typed flag validation error with a --print-schema hint by validateFlagAgainstSchema.","triggerScenarios":"Passing a --flag value that JSON-parses to a number below the schema's `minimum` for that property, e.g. a row index or limit field declared `minimum: 1` receiving 0 or a negative number.","commonSituations":"Using 0-based thinking for a 1-based field; computing an offset or count that underflows; templating a value from another command output that yields -1 or 0 for 'not found'.","solutions":["Raise the flag value to at least the schema minimum shown by --print-schema.","Check the field's expected range in the schema and clamp/validate inputs before invoking the command.","If the value comes from upstream output, guard sentinel values like -1 or 0 before passing them through."],"exampleFix":"// before\nlark-cli sheets batch --values '{\"start_row\": 0}'  // minimum is 1\n// after\nlark-cli sheets batch --values '{\"start_row\": 1}'","handlingStrategy":"validation","validationCode":"const min = 1; // from schema minimum\nif (typeof value === \"number\" && value < min) {\n  throw new Error(`value must be >= ${min}, got ${value}`);\n}","typeGuard":"function isNumberAtLeast(v: unknown, min: number): v is number {\n  return typeof v === \"number\" && Number.isFinite(v) && v >= min;\n}","tryCatchPattern":null,"preventionTips":["Run --print-schema before constructing numeric flags to learn minimum/maximum.","Clamp computed values to schema bounds before invoking.","Guard sentinel values like -1 from upstream lookups."],"tags":["sheets","schema-validation","cli"],"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"}