{"record":{"id":"a2a199f486ceb5fe","repo":"projectdiscovery/nuclei","slug":"failed-to-identify-template-format-expected-json-o","errorCode":null,"errorMessage":"failed to identify template format expected JSON or YAML but got %v","messagePattern":"failed to identify template format expected JSON or YAML but got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/templates/parser.go","lineNumber":197,"sourceCode":"\t\t}\n\tcase config.YAML:\n\t\tif data != nil {\n\t\t\t// Already read and preprocessed\n\t\t\tif p.NoStrictSyntax {\n\t\t\t\terr = yamlutil.Unmarshal(data, template)\n\t\t\t} else {\n\t\t\t\terr = yamlutil.UnmarshalStrict(data, template)\n\t\t\t}\n\t\t} else {\n\t\t\t// Stream directly from reader\n\t\t\tdecoder := yamlutil.NewDecoder(reader)\n\t\t\tif !p.NoStrictSyntax {\n\t\t\t\tdecoder.SetStrict(true)\n\t\t\t}\n\t\t\terr = decoder.Decode(template)\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"failed to identify template format expected JSON or YAML but got %v\", templatePath)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tp.parsedTemplatesCache.StoreWithoutRaw(templatePath, template, nil)\n\n\treturn template, nil\n}\n\n// LoadWorkflow returns true if the workflow is valid and matches the filtering criteria.\nfunc (p *Parser) LoadWorkflow(templatePath string, catalog catalog.Catalog) (bool, error) {\n\tt, templateParseError := p.ParseTemplate(templatePath, catalog)\n\tif templateParseError != nil {\n\t\treturn false, templateParseError\n\t}\n\n\ttemplate, ok := t.(*Template)","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/templates/parser.go#L179-L215","documentation":"Error \"failed to identify template format expected JSON or YAML but got %v\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/templates/parser.go:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}