{"record":{"id":"663ac1df7cbaf371","repo":"projectdiscovery/nuclei","slug":"invalid-extractor-type-s","errorCode":null,"errorMessage":"Invalid extractor type: %s","messagePattern":"Invalid extractor type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/operators/extractors/extractor_types.go","lineNumber":59,"sourceCode":"}\n\n// GetSupportedExtractorTypes returns list of supported types\nfunc GetSupportedExtractorTypes() []ExtractorType {\n\tvar result []ExtractorType\n\tfor index := ExtractorType(1); index < limit; index++ {\n\t\tresult = append(result, index)\n\t}\n\treturn result\n}\n\nfunc toExtractorTypes(valueToMap string) (ExtractorType, error) {\n\tnormalizedValue := normalizeValue(valueToMap)\n\tfor key, currentValue := range extractorMappings {\n\t\tif normalizedValue == currentValue {\n\t\t\treturn key, nil\n\t\t}\n\t}\n\treturn -1, errors.New(\"Invalid extractor type: \" + valueToMap)\n}\n\nfunc normalizeValue(value string) string {\n\treturn strings.TrimSpace(strings.ToLower(value))\n}\n\nfunc (t ExtractorType) String() string {\n\treturn extractorMappings[t]\n}\n\n// ExtractorTypeHolder is used to hold internal type of the extractor\ntype ExtractorTypeHolder struct {\n\tExtractorType ExtractorType `mapping:\"true\"`\n}\n\nfunc (holder ExtractorTypeHolder) JSONSchema() *jsonschema.Schema {\n\tgotType := &jsonschema.Schema{\n\t\tType:        \"string\",","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/operators/extractors/extractor_types.go#L41-L77","documentation":"Raised by toExtractorTypes when a template extractor's type field, after TrimSpace + ToLower, matches none of extractorMappings. Supported extractor types are exactly: regex, kval, xpath, json, dsl (extractor_types.go:30-36). ExtractorTypeHolder.UnmarshalYAML propagates the error, so template compilation fails.","triggerScenarios":"An extractor with type: jsonpath, type: grok, or type: css; any value outside the five-word enum.","commonSituations":"Names borrowed from other frameworks (jsonpath, css, regex-group); upgrading templates written for forks that added extra extractor kinds.","solutions":["Use one of: regex, kval, xpath, json, dsl","For JSON path selection use type: json with a json path expression; for CSS/HTML use type: xpath","Run nuclei -validate to catch it at template load"],"exampleFix":"# before\nextractors:\n  - type: jsonpath\n    jsonpath: ['$.user']\n# after\nextractors:\n  - type: json\n    json: ['$.user']","handlingStrategy":"validation","validationCode":"var validExtractorTypes = map[string]bool{\"regex\": true, \"kval\": true, \"xpath\": true, \"json\": true, \"dsl\": true}\nfunc extractorTypeOK(s string) bool { return validExtractorTypes[strings.ToLower(strings.TrimSpace(s))] }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain a lint rule whitelisting the five extractor types","Map foreign names (jsonpath->json, css->xpath) in a preprocessing step"],"tags":["template","extractors","yaml","validation"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}