{"record":{"id":"637473a9716e4a1c","repo":"mikefarah/yq","slug":"unknown-format-v-please-use-v","errorCode":null,"errorMessage":"unknown format '%v' please use [%v]","messagePattern":"unknown format '(.+?)' please use \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/format.go","lineNumber":151,"sourceCode":"\t\t\t\treturn format\n\t\t\t}\n\t\t\tGetLogger().Debugf(\"extension '%s' is not a recognised format, defaulting to yaml\", format)\n\t\t}\n\t}\n\n\tGetLogger().Debugf(\"using default inputFormat 'yaml'\")\n\treturn \"yaml\"\n}\n\nfunc FormatFromString(format string) (*Format, error) {\n\tif format != \"\" {\n\t\tfor _, printerFormat := range Formats {\n\t\t\tif printerFormat.MatchesName(format) {\n\t\t\t\treturn printerFormat, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"unknown format '%v' please use [%v]\", format, GetAvailableOutputFormatString())\n}\n\nfunc GetAvailableOutputFormats() []*Format {\n\tvar formats = []*Format{}\n\tfor _, printerFormat := range Formats {\n\t\tif printerFormat.EncoderFactory != nil {\n\t\t\tformats = append(formats, printerFormat)\n\t\t}\n\t}\n\treturn formats\n}\n\nfunc GetAvailableOutputFormatString() string {\n\tvar formats = []string{}\n\tfor _, printerFormat := range GetAvailableOutputFormats() {\n\n\t\tif printerFormat.FormalName != \"\" {\n\t\t\tformats = append(formats, printerFormat.FormalName)","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/format.go#L133-L169","documentation":"FormatFromString was asked for a format name (or alias) that matches none of the registered Formats — the string passed via -p/-o/--from or the file-extension lookup has a typo or names a format compiled out of this build (build-tag formats can be excluded). The message helpfully lists every available output format name.","triggerScenarios":"Thrown at pkg/yqlib/format.go:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the formats listed in the error message","Check for typos in the format flag (e.g. 'jsn' vs 'json'; valid short aliases include @json/@yq style names)","If the format should exist, rebuild yq without the yq_no<format> build tag","Omit the flag to fall back to the default yaml format"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}