{"record":{"id":"a9889b8c2d073769","repo":"larksuite/cli","slug":"boolean-field-has-incompatible-schema-constraint","errorCode":null,"errorMessage":"boolean field has incompatible schema constraint","messagePattern":"boolean field has incompatible schema constraint","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_data.go","lineNumber":90,"sourceCode":"\tvar shape typedValueShape\n\tswitch baseType.Kind() {\n\tcase reflect.String:\n\t\tstringShape := typedStringShape{Format: schema.format, MinLength: schema.minLength, MaxLength: schema.maxLength}\n\t\tfor _, raw := range schema.enum {\n\t\t\tstringShape.Enum = append(stringShape.Enum, raw)\n\t\t}\n\t\tshape = stringShape\n\tcase reflect.Bool:\n\t\tbooleanShape := typedBooleanShape{}\n\t\tfor _, raw := range schema.enum {\n\t\t\tv, err := parseBool(raw)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"enum value %q is not boolean\", raw)\n\t\t\t}\n\t\t\tbooleanShape.Enum = append(booleanShape.Enum, v)\n\t\t}\n\t\tif hasStringConstraints(schema) || hasNumberConstraints(schema) || hasItemConstraints(schema) {\n\t\t\treturn nil, fmt.Errorf(\"boolean field has incompatible schema constraint\")\n\t\t}\n\t\tshape = booleanShape\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:\n\t\tif input && baseType.Kind() >= reflect.Uint && baseType.Kind() <= reflect.Uint64 {\n\t\t\treturn nil, fmt.Errorf(\"unsigned integer CLI input %s is not supported; use int or an explicit JSON encoding\", baseType)\n\t\t}\n\t\tintegerShape := typedIntegerShape{}\n\t\tif schema.minimum != nil {\n\t\t\tv := int64(*schema.minimum)\n\t\t\tif float64(v) != *schema.minimum {\n\t\t\t\treturn nil, fmt.Errorf(\"minimum must be an integer\")\n\t\t\t}\n\t\t\tintegerShape.Minimum = &v\n\t\t}\n\t\tif schema.maximum != nil {\n\t\t\tv := int64(*schema.maximum)\n\t\t\tif float64(v) != *schema.maximum {\n\t\t\t\treturn nil, fmt.Errorf(\"maximum must be an integer\")","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_data.go#L72-L108","documentation":"Compile-time guard in shapeForType: a boolean field declares string, number, or item schema constraints that cannot apply to a boolean type.","triggerScenarios":"Thrown at shortcuts/common/typed_compile_data.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the inapplicable constraints from the bool field's schema tag"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}