{"record":{"id":"e01d9d76bc9c375a","repo":"owasp-amass/amass","slug":"invalid-from-type-s-does-not-comply-with-oam","errorCode":null,"errorMessage":"invalid 'From' type: %s does not comply with OAM","messagePattern":"invalid 'From' type: (.+?) does not comply with OAM","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":148,"sourceCode":"\ttfound := false\n\tffound := false\n\t// Check if \"From\" and \"To\" is OAM compliant\n\tfor _, a := range oam.AssetList {\n\t\ta := strings.ToLower(string(a))\n\t\tif t.From == a {\n\t\t\tffound = true\n\t\t}\n\t\tif t.To == a || t.To == \"none\" || t.To == \"all\" {\n\t\t\ttfound = true\n\t\t}\n\t\t// Used to prevent unnecessary iterations\n\t\tif tfound && ffound {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !ffound {\n\t\treturn fmt.Errorf(\"invalid 'From' type: %s does not comply with OAM\", t.From)\n\t}\n\t// Check for a 'none' transformation, which indicates that no further processing is required for this 'From' type.\n\tif t.To == \"none\" {\n\t\t// Conflict arises if there's already a valid transformation for this 'From'.\n\t\tif c.fromWithValid[t.From] {\n\t\t\treturn fmt.Errorf(\"invalid config: 'none' specified after a valid transformation for 'From' type: %s. 'None' should be the only transformation\", t.From)\n\t\t}\n\t\tc.fromWithNone[t.From] = true\n\t} else { // For other valid transformations.\n\t\t// Conflict arises if a 'none' transformation is already registered for this 'From'.\n\t\tif c.fromWithNone[t.From] {\n\t\t\treturn fmt.Errorf(\"invalid config: valid transformation specified after 'none' for 'From' type: %s. 'None' should be the only transformation\", t.From)\n\t\t}\n\t\t// Mark this 'From' as having a valid transformation.\n\t\tc.fromWithValid[t.From] = true\n\t}\n\n\treturn nil","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L130-L166","documentation":"This error means a transformation entry in the session config declares a 'From' type that is not a recognized OAM (OpenAPI App Model) type. During Config.Validate, each transformation's From field is checked against the set of valid OAM types; if no match is found, validation fails immediately. It is a static configuration error, not a runtime data error.","triggerScenarios":"Calling Config.Validate when a transformations entry has a From value that is not one of the supported OAM types (e.g. a typo like 'workloadtype' or a custom string).","commonSituations":"Typos in YAML/JSON workload configs, hand-edited transformation sections, or configs written against an older/newer OAM spec where type names changed.","solutions":["Fix the 'From' value in the transformation config to a valid OAM type","Check the valid type list in config/transform.go and align your config","Validate the config with a linter/schema before calling Validate"],"exampleFix":"// before\ntransformations:\n  - from: workloadtyp\n    to: deployment\n// after\ntransformations:\n  - from: workloadType\n    to: deployment","handlingStrategy":"validation","validationCode":"validFrom := map[string]bool{\"workloadType\":true,\"trait\":true,\"scope\":true}\nif !validFrom[t.From] { return fmt.Errorf(\"unsupported From type %q\", t.From) }","typeGuard":null,"tryCatchPattern":"if err := cfg.Validate(); err != nil {\n  if strings.HasPrefix(err.Error(), \"invalid 'From' type\") {\n    // log offending transformation and skip/fix it\n  }\n  return err\n}","preventionTips":["Keep transformation configs aligned with the OAM type list in config/transform.go","Run Validate early at startup, before any processing","Schema-validate config files in CI"],"tags":["config","validation","oam"],"backgroundTag":"invalid-enum-value","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"}