larksuite/cli · error

minimum must be an integer

Error message

minimum must be an integer

What it means

Compile-time guard in shapeForType: a minimum constraint on an integer field is not a whole number and cannot be narrowed to int64.

Source

Thrown at shortcuts/common/typed_compile_data.go:101

			v, err := parseBool(raw)
			if err != nil {
				return nil, fmt.Errorf("enum value %q is not boolean", raw)
			}
			booleanShape.Enum = append(booleanShape.Enum, v)
		}
		if hasStringConstraints(schema) || hasNumberConstraints(schema) || hasItemConstraints(schema) {
			return nil, fmt.Errorf("boolean field has incompatible schema constraint")
		}
		shape = booleanShape
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		if input && baseType.Kind() >= reflect.Uint && baseType.Kind() <= reflect.Uint64 {
			return nil, fmt.Errorf("unsigned integer CLI input %s is not supported; use int or an explicit JSON encoding", baseType)
		}
		integerShape := typedIntegerShape{}
		if schema.minimum != nil {
			v := int64(*schema.minimum)
			if float64(v) != *schema.minimum {
				return nil, fmt.Errorf("minimum must be an integer")
			}
			integerShape.Minimum = &v
		}
		if schema.maximum != nil {
			v := int64(*schema.maximum)
			if float64(v) != *schema.maximum {
				return nil, fmt.Errorf("maximum must be an integer")
			}
			integerShape.Maximum = &v
		}
		for _, raw := range schema.enum {
			v, err := strconv.ParseInt(raw, 10, baseType.Bits())
			if err != nil {
				return nil, fmt.Errorf("enum value %q is not integer", raw)
			}
			integerShape.Enum = append(integerShape.Enum, v)
		}
		if hasStringConstraints(schema) || hasItemConstraints(schema) || schema.format != "" {

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Use an integer literal for minimum on int fields
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at shortcuts/common/typed_compile_data.go:101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/8efa7b7e6a7b647d. Report an issue: GitHub.