{"record":{"id":"0c3a6b8b52f3ec68","repo":"mikefarah/yq","slug":"unsupported-inline-table-value-kind-v","errorCode":null,"errorMessage":"unsupported inline table value kind: %v","messagePattern":"unsupported inline table value kind: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/encoder_toml.go","lineNumber":455,"sourceCode":"\t\t\t\tcontinue\n\t\t\t}\n\t\t\tparts = append(parts, fmt.Sprintf(\"%s = %s\", tomlKey(k), te.formatScalar(v)))\n\t\tcase SequenceNode:\n\t\t\t// inline array in inline table\n\t\t\tarr, err := te.sequenceToInlineArray(v)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tparts = append(parts, fmt.Sprintf(\"%s = %s\", tomlKey(k), arr))\n\t\tcase MappingNode:\n\t\t\t// nested inline table\n\t\t\tinline, err := te.mappingToInlineTable(v)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\tparts = append(parts, fmt.Sprintf(\"%s = %s\", tomlKey(k), inline))\n\t\tdefault:\n\t\t\treturn \"\", fmt.Errorf(\"unsupported inline table value kind: %v\", v.Kind)\n\t\t}\n\t}\n\treturn \"{ \" + strings.Join(parts, \", \") + \" }\", nil\n}\n\nfunc (te *tomlEncoder) writeInlineTableAttribute(w io.Writer, key string, m *CandidateNode) error {\n\tinline, err := te.mappingToInlineTable(m)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = w.Write([]byte(tomlKey(key) + \" = \" + inline + \"\\n\"))\n\treturn err\n}\n\nfunc (te *tomlEncoder) writeTableHeader(w io.Writer, path []string, m *CandidateNode) error {\n\t// Add blank line before table header (or before comment if present) if we wrote root attributes\n\tneedsBlankLine := te.wroteRootAttr\n\tif needsBlankLine {","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/encoder_toml.go#L437-L473","documentation":"mappingToInlineTable builds a TOML inline table and accepts only scalar, sequence and mapping values for each key; any other value kind (typically an AliasNode, since plain nulls are skipped) triggers this error. It fires from inline tables both at top level (writeInlineTableAttribute) and nested inside arrays.","triggerScenarios":"Encoding `-o toml` a map value like `k: *alias` or any non-scalar/seq/map node inside a mapping that must be rendered as an inline table (top-level table arrays context or values nested in arrays).","commonSituations":"YAML anchors used for shared config values converted to TOML; documents where merge keys or aliases appear inside inline-table positions; programmatic tree construction with alias nodes.","solutions":["Dereference aliases first via JSON round-trip: yq -o json in.yaml | yq -o toml.","Replace the alias/unsupported value with its concrete value in the YAML.","Drop the key (nulls are skipped) or move the value to a position rendered as a regular table.","Patch mappingToInlineTable to resolve AliasNode to its target node."],"exampleFix":"// before\ncommon: &c {a: 1}\ntbl: {x: *c}\n// after\ntbl: {x: {a: 1}}","handlingStrategy":"type-guard","validationCode":"yq '.tbl | to_entries | any(.value | kind == \"alias\" or kind == \"null\")' in.yaml","typeGuard":"// Go\nfunc inlineTableSafe(m *yqlib.CandidateNode) bool {\n    for i := 1; i < len(m.Content); i += 2 {\n        switch m.Content[i].Kind {\n        case yqlib.ScalarNode, yqlib.SequenceNode, yqlib.MappingNode:\n        default: return false\n        }\n    }\n    return true\n}","tryCatchPattern":"// Go\nif _, err := mappingToInlineTable(m); err != nil {\n    if strings.Contains(err.Error(), \"unsupported inline table value kind\") {\n        // resolve alias or drop key, retry\n    }\n}","preventionTips":["Replace aliases inside maps destined for inline tables","Remember nulls are skipped but aliases are rejected — inline values explicitly","Validate map values with `kind` before converting to TOML"],"tags":["toml","encoder","yaml-aliases","inline-table"],"backgroundTag":"toml-alias-unsupported","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"}