{"record":{"id":"b576def8d43c1370","repo":"owasp-amass/amass","slug":"invalid-type-for-default-transform-values","errorCode":null,"errorMessage":"invalid type for default_transform_values","messagePattern":"invalid type for default_transform_values","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":77,"sourceCode":"\t\t\ttransformation.TTL = c.DefaultTransformations.TTL\n\t\t}\n\n\t\terr := transformation.Validate(c)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// If the loop completes with no conflicts, the function returns nil, indicating success.\n\treturn nil\n}\n\nfunc (c *Config) loadGlobalTransformSettings() error {\n\t// get the default_transfom_values in the config yaml\n\tif dtv, ok := c.Options[\"default_transform_values\"]; ok {\n\t\t// Assert the type to map[interface{}]interface{}\n\t\tdtvMap, ok := dtv.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"invalid type for default_transform_values\")\n\t\t}\n\t\t// Convert the map to the Transformation struct\n\t\tif ttl, ok := dtvMap[\"ttl\"].(int); ok {\n\t\t\tc.DefaultTransformations.TTL = ttl\n\t\t} else if !ok && dtvMap[\"ttl\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for ttl in default_transform_values\")\n\t\t}\n\t\tif confidence, ok := dtvMap[\"confidence\"].(int); ok {\n\t\t\tc.DefaultTransformations.Confidence = confidence\n\t\t} else if !ok && dtvMap[\"confidence\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for confidence in default_transform_values\")\n\t\t}\n\t\tif priority, ok := dtvMap[\"priority\"].(int); ok {\n\t\t\tc.DefaultTransformations.Priority = priority\n\t\t} else if !ok && dtvMap[\"priority\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for priority in default_transform_values\")\n\t\t}\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L59-L95","documentation":"loadGlobalTransformSettings reads the optional 'default_transform_values' key from config Options and asserts it is a map[string]interface{}. Any other type triggers this error. It means the YAML value for default_transform_values is not a mapping (e.g. a string, list, or scalar).","triggerScenarios":"Config YAML with 'default_transform_values: something' as a string, array, or scalar instead of a nested map with keys ttl/confidence/priority; YAML type coercion may also yield map[interface{}]interface{} which fails the assertion.","commonSituations":"Malformed YAML indentation collapsing the mapping, quoting the whole block into a string, or older YAML parsers (yaml.v2) delivering map[interface{}]interface{} instead of map[string]interface{}.","solutions":["Make default_transform_values a YAML mapping: 'default_transform_values:\\n  ttl: 60\\n  confidence: 80\\n  priority: 1'","Check indentation so the child keys are nested under the key, not a string block","If using yaml.v2 with non-string keys, convert or switch to yaml.v3 to get map[string]interface{}"],"exampleFix":"// before\ndefault_transform_values: \"ttl=60\"\n// after\ndefault_transform_values:\n  ttl: 60","handlingStrategy":"type-guard","validationCode":"if dtv, ok := c.Options[\"default_transform_values\"]; ok {\n\tif _, ok := dtv.(map[string]interface{}); !ok {\n\t\treturn errors.New(\"default_transform_values must be a YAML mapping\")\n\t}\n}","typeGuard":"func isStringMap(v interface{}) bool { _, ok := v.(map[string]interface{}); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(path); err != nil {\n\tif strings.Contains(err.Error(), \"invalid type for default_transform_values\") {\n\t\treturn fmt.Errorf(\"fix default_transform_values in %s: must be a mapping\", path)\n\t}\n\treturn err\n}","preventionTips":["Keep default_transform_values as a nested YAML mapping","Check indentation with a YAML linter","Beware yaml.v2 delivering map[interface{}]interface{}; use yaml.v3 or convert"],"tags":["config","yaml","type-error","amass"],"backgroundTag":"config-type-mismatch","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}