{"record":{"id":"bd1f9f9044037df9","repo":"larksuite/cli","slug":"s-must-be-a-boolean-got-s","errorCode":null,"errorMessage":"--%s must be a boolean, got %s","messagePattern":"--(.+?) must be a boolean, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/sheets/flag_view.go","lineNumber":315,"sourceCode":"\t\tswitch typ {\n\t\tcase \"int\":\n\t\t\t// Int(): float64 → int(t) truncates, so a non-integer number would\n\t\t\t// be silently floored (1.9 → 1). Standalone cobra rejects it at\n\t\t\t// parse time; reject here too to keep batch/standalone parity.\n\t\t\tf, isNum := val.(float64)\n\t\t\tif !isNum {\n\t\t\t\treturn fmt.Errorf(\"--%s must be a number, got %s\", name, jsonTypeName(val)) //nolint:forbidigo // intermediate error; the batch dispatcher wraps it into a typed operations validation error\n\t\t\t}\n\t\t\tif math.Trunc(f) != f {\n\t\t\t\treturn fmt.Errorf(\"--%s must be an integer, got %s\", name, strconv.FormatFloat(f, 'g', -1, 64)) //nolint:forbidigo // intermediate error; the batch dispatcher wraps it into a typed operations validation error\n\t\t\t}\n\t\tcase \"float64\":\n\t\t\tif _, isNum := val.(float64); !isNum {\n\t\t\t\treturn fmt.Errorf(\"--%s must be a number, got %s\", name, jsonTypeName(val)) //nolint:forbidigo // intermediate error; the batch dispatcher wraps it into a typed operations validation error\n\t\t\t}\n\t\tcase \"bool\":\n\t\t\tif _, isBool := val.(bool); !isBool {\n\t\t\t\treturn fmt.Errorf(\"--%s must be a boolean, got %s\", name, jsonTypeName(val)) //nolint:forbidigo // intermediate error; the batch dispatcher wraps it into a typed operations validation error\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// normalizeAndValidateEnums applies the same flat string-enum contract as the\n// standalone cobra path. Canonical casing and known aliases are rewritten in\n// place; unknown values are rejected before a translator can silently fall\n// back to a different operation.\nfunc (m *mapFlagView) normalizeAndValidateEnums() error {\n\tdefs, err := loadFlagDefs()\n\tif err != nil {\n\t\treturn nil //nolint:nilerr // match validateRawTypes: missing embedded metadata must not block the batch\n\t}\n\tspec, ok := defs[m.command]\n\tif !ok {\n\t\treturn nil","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/sheets/flag_view.go#L297-L333","documentation":"validateRawTypes, the batch dispatcher's standalone-parity check: a JSON-typed flag value for a boolean flag is not bool. Standalone cobra would reject it at parse time; the batch JSON path rejects it here so both entry points behave alike.","triggerScenarios":"Thrown at shortcuts/sheets/flag_view.go:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass true/false for boolean flags in batch JSON"],"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"}