{"record":{"id":"3c37c507a99109d2","repo":"helm/helm","slug":"s-should-be-of-type-string-but-it-s-of-type-s-3c37c5","errorCode":null,"errorMessage":"%s should be of type string but it's of type %s","messagePattern":"(.+?) should be of type string but it's of type (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/chart/v2/lint/rules/chartfile.go","lineNumber":88,"sourceCode":"\tlinter.RunLinterRule(support.WarningSev, chartFileName, validateChartVersionStrictSemVerV2(chartFile))\n}\n\nfunc validateChartVersionType(data map[string]any) error {\n\treturn isStringValue(data, \"version\")\n}\n\nfunc validateChartAppVersionType(data map[string]any) error {\n\treturn isStringValue(data, \"appVersion\")\n}\n\nfunc isStringValue(data map[string]any, key string) error {\n\tvalue, ok := data[key]\n\tif !ok {\n\t\treturn nil\n\t}\n\tvalueType := fmt.Sprintf(\"%T\", value)\n\tif valueType != \"string\" {\n\t\treturn fmt.Errorf(\"%s should be of type string but it's of type %s\", key, valueType)\n\t}\n\treturn nil\n}\n\nfunc validateChartYamlNotDirectory(chartPath string) error {\n\tfi, err := os.Stat(chartPath)\n\n\tif err == nil && fi.IsDir() {\n\t\treturn errors.New(\"should be a file, not a directory\")\n\t}\n\treturn nil\n}\n\nfunc validateChartYamlFormat(chartFileError error) error {\n\tif chartFileError != nil {\n\t\treturn fmt.Errorf(\"unable to parse YAML\\n\\t%w\", chartFileError)\n\t}\n\treturn nil","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/helm/helm/blob/2a29f1770b62844b27197d2507377361d45ad7c0/pkg/chart/v2/lint/rules/chartfile.go#L70-L106","documentation":"Lint rule (helm lint / rules.Chartfile) reporting that the appVersion field in Chart.yaml parsed to a non-string Go type. loadChartFileForTypeCheck reads Chart.yaml into map[string]any, and isStringValue requires the appVersion value to unmarshal to a Go string; e.g. `appVersion: 1.2` becomes float64 and fails with type float64.","triggerScenarios":"Chart.yaml containing `appVersion: 1.16` (unquoted semantic version) or `appVersion: true`; the value must be written as `appVersion: \"1.16\"`. Reported at ErrorSev, so it fails lint.","commonSituations":"Authors writing YAML scalars without quotes; copy-paste from Kubernetes manifests where numbers are fine; migration from older charts where quoting was not enforced.","solutions":["Quote the value in Chart.yaml: appVersion: \"1.16.0\".","Quote the version field too (same check applies to version via validateChartVersionType).","Run `helm lint` locally before pushing; CI lint steps catch this cheaply."],"exampleFix":"# before\napiVersion: v2\nname: mychart\nversion: 1.0.0        # also fails the version type check\nappVersion: 1.16      # -> appVersion should be of type string but it's of type float64\n\n# after\napiVersion: v2\nname: mychart\nversion: \"1.0.0\"\nappVersion: \"1.16\"","handlingStrategy":"validation","validationCode":"// Go: assert appVersion/version are strings in Chart.yaml before packaging\nvar m map[string]any\nb, _ := os.ReadFile(\"Chart.yaml\")\n_ = yaml.Unmarshal(b, &m)\nfor _, k := range []string{\"version\", \"appVersion\"} {\n\tif v, ok := m[k]; ok && fmt.Sprintf(\"%T\", v) != \"string\" {\n\t\treturn fmt.Errorf(\"%s must be a quoted string\", k)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always quote version and appVersion in Chart.yaml.","Run `helm lint` (or `helm package`, which enforces metadata validity) in CI."],"tags":["helm","lint","chart-yaml","appversion","yaml-types"],"backgroundTag":null,"analyzedSha":"2a29f1770b62844b27197d2507377361d45ad7c0","analyzedAt":"2026-08-15T22:02:47.490Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}