{"record":{"id":"f170e163303dd55f","repo":"larksuite/cli","slug":"minimum-exceeds-maximum","errorCode":null,"errorMessage":"minimum exceeds maximum","messagePattern":"minimum exceeds maximum","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_args.go","lineNumber":507,"sourceCode":"\t\t\tresult.maxItems = &v\n\t\tdefault:\n\t\t\treturn result, fmt.Errorf(\"unknown schema token %q\", key)\n\t\t}\n\t}\n\tif result.required == result.optional {\n\t\treturn result, fmt.Errorf(\"schema must declare exactly one of required or optional\")\n\t}\n\tif result.required && result.defaultValue.Set {\n\t\treturn result, fmt.Errorf(\"required input cannot declare default\")\n\t}\n\tif result.nullable != nil && *result.nullable && !isNilCapable(valueType) {\n\t\treturn result, fmt.Errorf(\"nullable requires a nil-capable Go type\")\n\t}\n\tif result.minLength != nil && result.maxLength != nil && *result.minLength > *result.maxLength {\n\t\treturn result, fmt.Errorf(\"minLength exceeds maxLength\")\n\t}\n\tif result.minimum != nil && result.maximum != nil && *result.minimum > *result.maximum {\n\t\treturn result, fmt.Errorf(\"minimum exceeds maximum\")\n\t}\n\tif result.minItems != nil && result.maxItems != nil && *result.minItems > *result.maxItems {\n\t\treturn result, fmt.Errorf(\"minItems exceeds maxItems\")\n\t}\n\treturn result, nil\n}\n\nfunc parseCLITag(raw string) (typedCLIInput, error) {\n\tvar result typedCLIInput\n\tif raw == \"\" {\n\t\treturn result, nil\n\t}\n\tseen := make(map[string]struct{})\n\tfor _, token := range strings.Split(raw, \";\") {\n\t\tkey, value, ok := strings.Cut(token, \"=\")\n\t\tif !ok || value == \"\" || token != strings.TrimSpace(token) {\n\t\t\treturn result, fmt.Errorf(\"invalid cli token %q\", token)\n\t\t}","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_args.go#L489-L525","documentation":"When both `minimum` and `maximum` numeric bounds are declared in a schema tag, the minimum must not exceed the maximum. An inverted range can never be satisfied, so parseSchemaTag rejects the tag at compile time.","triggerScenarios":"A tag like schema:\"optional;minimum=100;maximum=10\" on a numeric input field.","commonSituations":"Transcribing bounds in the wrong order, changing one bound after a requirements change, or copying bounds from an inverted spec.","solutions":["Ensure minimum <= maximum in the tag.","Swap the two values if inverted.","Remove the redundant bound if only one limit is meaningful."],"exampleFix":"// before\nAmount float64 `schema:\"required;minimum=100;maximum=10\"`\n// after\nAmount float64 `schema:\"required;minimum=10;maximum=100\"`","handlingStrategy":"validation","validationCode":"func numericRangeOK(min, max *float64) bool {\n\treturn min == nil || max == nil || *min <= *max\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["State bounds as an interval [minimum, maximum] and verify ordering.","Update minimum and maximum in the same edit when requirements shift.","Add a compile-time test over all numeric input fields."],"tags":["go","struct-tags","schema-validation","bounds"],"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"}