{"record":{"id":"943f8afbff41b150","repo":"larksuite/cli","slug":"l2-field-q-minimum-v-maximum-v","errorCode":null,"errorMessage":"L2: field %q minimum (%v) >= maximum (%v)","messagePattern":"L2: field %q minimum \\((.+?)\\) >= maximum \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/schema/lint.go","lineNumber":126,"sourceCode":"\n\treturn errs\n}\n\n// walkForL2 recursively applies per-field L2 checks (format:binary on\n// non-string; minimum>=maximum) plus the sub-object required-exists invariant.\n// Required only matters on object-typed Properties (e.g. the params / data\n// wrappers); leaf scalars ignore it.\nfunc walkForL2(props *OrderedProps, errs *[]error) {\n\tif props == nil {\n\t\treturn\n\t}\n\tfor _, k := range props.Order {\n\t\tp := props.Map[k]\n\t\tif p.Format == \"binary\" && p.Type != \"string\" {\n\t\t\t*errs = append(*errs, fmt.Errorf(\"L2: field %q has format: binary but type = %q (want string)\", k, p.Type))\n\t\t}\n\t\tif p.Minimum != nil && p.Maximum != nil && *p.Minimum >= *p.Maximum {\n\t\t\t*errs = append(*errs, fmt.Errorf(\"L2: field %q minimum (%v) >= maximum (%v)\", k, *p.Minimum, *p.Maximum))\n\t\t}\n\t\tif n := len(p.EnumDescriptions); n > 0 && n != len(p.Enum) {\n\t\t\t*errs = append(*errs, fmt.Errorf(\"L2: field %q enumDescriptions length (%d) != enum length (%d)\", k, n, len(p.Enum)))\n\t\t}\n\t\tif len(p.Required) > 0 && p.Properties != nil {\n\t\t\tfor _, r := range p.Required {\n\t\t\t\tif _, ok := p.Properties.Map[r]; !ok {\n\t\t\t\t\t*errs = append(*errs, fmt.Errorf(\"L2: required key %q in %q not found in its properties\", r, k))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif p.Properties != nil {\n\t\t\twalkForL2(p.Properties, errs)\n\t\t}\n\t}\n}\n\n// validatePropertyTypes walks an OrderedProps tree and asserts:","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/schema/lint.go#L108-L144","documentation":"L2 schema lint failure: a field declares both minimum and maximum with minimum >= maximum, an unsatisfiable numeric range. Caught while walking the schema property tree before commands are generated.","triggerScenarios":"A property has non-nil Minimum and Maximum with *Minimum >= *Maximum (e.g. min:10 max:10, or min:5 max:1).","commonSituations":"Off-by-one when copying range bounds; metadata source where max was edited down; nullable pointers pointing at swapped values.","solutions":["Swap Minimum and Maximum if they were reversed","Lower Minimum or raise Maximum so Minimum < Maximum","Remove one bound if only a one-sided constraint is intended","Fix the upstream metadata generation that produced equal/invalid bounds"],"exampleFix":"// before\nProperty{Minimum: &ten, Maximum: &ten}\n// after\nProperty{Minimum: &one, Maximum: &ten}","handlingStrategy":"validation","validationCode":"if p.Minimum != nil && p.Maximum != nil && *p.Minimum >= *p.Maximum {\n  return fmt.Errorf(\"field %s: min %v >= max %v\", name, *p.Minimum, *p.Maximum)\n}","typeGuard":"func hasValidRange(p *Property) bool { return p.Minimum == nil || p.Maximum == nil || *p.Minimum < *p.Maximum }","tryCatchPattern":null,"preventionTips":["Verify min < max whenever writing numeric bounds","Swap-check bounds copied from upstream docs","Prefer one-sided bounds when only one limit is meaningful"],"tags":["json-schema","lint","numeric-bounds"],"backgroundTag":"json-schema-type-mismatch","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"}