{"record":{"id":"9f1ebc946e75a0f5","repo":"mikefarah/yq","slug":"unknown-style-v","errorCode":null,"errorMessage":"unknown style %v","messagePattern":"unknown style (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/operator_style.go","lineNumber":22,"sourceCode":"\t\"container/list\"\n\t\"fmt\"\n)\n\nfunc parseStyle(customStyle string) (Style, error) {\n\tif customStyle == \"tagged\" {\n\t\treturn TaggedStyle, nil\n\t} else if customStyle == \"double\" {\n\t\treturn DoubleQuotedStyle, nil\n\t} else if customStyle == \"single\" {\n\t\treturn SingleQuotedStyle, nil\n\t} else if customStyle == \"literal\" {\n\t\treturn LiteralStyle, nil\n\t} else if customStyle == \"folded\" {\n\t\treturn FoldedStyle, nil\n\t} else if customStyle == \"flow\" {\n\t\treturn FlowStyle, nil\n\t} else if customStyle != \"\" {\n\t\treturn 0, fmt.Errorf(\"unknown style %v\", customStyle)\n\t}\n\treturn 0, nil\n}\n\nfunc assignStyleOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {\n\n\tlog.Debugf(\"AssignStyleOperator\")\n\tvar style Style\n\tif !expressionNode.Operation.UpdateAssign {\n\t\trhs, err := d.GetMatchingNodes(context.ReadOnlyClone(), expressionNode.RHS)\n\t\tif err != nil {\n\t\t\treturn Context{}, err\n\t\t}\n\n\t\tif rhs.MatchingNodes.Front() != nil {\n\t\t\tstyle, err = parseStyle(rhs.MatchingNodes.Front().Value.(*CandidateNode).Value)\n\t\t\tif err != nil {\n\t\t\t\treturn Context{}, err","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/operator_style.go#L4-L40","documentation":"parseStyle in operator_style.go maps a user-supplied style name to yq's style constants. Only known names ('single', 'double', 'literal', 'folded', 'flow', '' for reset) are accepted; any other non-empty string passed to the style assignment operator ('style=...') fails with 'unknown style'.","triggerScenarios":"Expressions like '.. style= \"singlequote\"', '.a style= \"Multi\"', or '.x style=\"plain\"' — any misspelled, wrongly-cased, or unsupported style name given to the style operator via assignStyleOperator.","commonSituations":"Typos (\"singlequotes\", \"litteral\", \"bloack\"); copying jq-style assumptions; expecting quoting keywords like 'raw' or 'quoted' to exist; case sensitivity mistakes ('Flow' vs 'flow').","solutions":["Use one of the supported style names exactly: 'flow', 'single', 'double', 'literal', 'folded', or '' (empty to reset).","Fix case sensitivity — style names are lowercase (e.g. 'flow' not 'Flow').","If you want plain/default output, reset with 'style=\"\"' instead of guessing a style name."],"exampleFix":"// before (fails)\nyq '.. style= \"singlequote\"' file.yaml\n\n// after\nyq '.. style= \"single\"' file.yaml","handlingStrategy":"validation","validationCode":"case \"$STYLE\" in flow|single|double|literal|folded|\"\") ;; *) echo \"unknown style: $STYLE\"; exit 1;; esac\n# then safely: yq \".a style= \\\"$STYLE\\\"\" file.yaml","typeGuard":null,"tryCatchPattern":"out=$(yq \".a style= \\\"$STYLE\\\"\" file.yaml 2>&1) || { echo \"style assignment failed: $out\"; exit 1; }","preventionTips":["Memorize the accepted set: flow, single, double, literal, folded, and '' to reset.","Keep style names lowercase; do not invent aliases like 'quoted' or 'raw'.","Use style='\"\"' rather than guessing a default-style keyword."],"tags":["yq","style","invalid-argument","operator"],"backgroundTag":"invalid-enum-value","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"}