{"record":{"id":"ae3f3d53ab431cb3","repo":"stride3d/stride","slug":"while-parsing-a-flow-mapping-did-not-find-expected-or","errorCode":null,"errorMessage":"While parsing a flow mapping,  did not find expected ',' or '}'.","messagePattern":"While parsing a flow mapping,  did not find expected ',' or '\\}'\\.","errorType":"exception","errorClass":"SemanticErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Parser.cs","lineNumber":894,"sourceCode":"        {\n            if (isFirst)\n            {\n                GetCurrentToken();\n                Skip();\n            }\n\n            if (!(GetCurrentToken() is FlowMappingEnd))\n            {\n                if (!isFirst)\n                {\n                    if (GetCurrentToken() is FlowEntry)\n                    {\n                        Skip();\n                    }\n                    else\n                    {\n                        var current = GetCurrentToken();\n                        throw new SemanticErrorException(current.Start, current.End, \"While parsing a flow mapping,  did not find expected ',' or '}'.\");\n                    }\n                }\n\n                if (GetCurrentToken() is Key)\n                {\n                    Skip();\n\n                    if (!(GetCurrentToken() is Value || GetCurrentToken() is FlowEntry || GetCurrentToken() is FlowMappingEnd))\n                    {\n                        states.Push(ParserState.YAML_PARSE_FLOW_MAPPING_VALUE_STATE);\n                        return ParseNode(false, false);\n                    }\n                    else\n                    {\n                        state = ParserState.YAML_PARSE_FLOW_MAPPING_VALUE_STATE;\n                        return ProcessEmptyScalar(GetCurrentToken().Start);\n                    }\n                }","sourceCodeStart":876,"sourceCodeEnd":912,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Parser.cs#L876-L912","documentation":"YAML parser error in Parser.ParseFlowMappingKey: inside a flow mapping ({...}), after the first key the next token was neither a comma (FlowEntry) nor the closing brace, so the parser cannot continue the flow mapping. Caused by malformed flow-mapping syntax such as a missing comma between entries or an unexpected token.","triggerScenarios":"A flow mapping like {a: 1 b: 2} (missing comma between pairs), an unclosed '{', or an illegal token inside { ... }.","commonSituations":"Inline JSON-ish YAML objects in config files where a comma was dropped or the closing '}' was deleted during editing.","solutions":["Add the missing ',' between flow mapping entries","Close the mapping with '}' where intended","Remove stray characters/tokens inside the flow mapping"],"exampleFix":"// before\nlimits: {cpu: 2 memory: 4Gi\n// after\nlimits: {cpu: 2, memory: 4Gi}","handlingStrategy":"validation","validationCode":"// Reject flow mappings with obviously missing separators before load\nvar lines = yamlText.Split('\\n'); foreach (var l in lines) if (System.Text.RegularExpressions.Regex.IsMatch(l, \"\\\\{[^}]*\\\\w\\\\s+\\\\w+\\\\s*[^,:}\\\\n]\")) throw new FormatException(\"Possible missing ',' in flow mapping: \" + l);","typeGuard":null,"tryCatchPattern":"try { yaml.Load(reader); } catch (YamlException ex) { throw new ConfigFormatException($\"Flow mapping error at {ex.Start.Line}:{ex.Start.Column}\"); }","preventionTips":["Validate inline JSON-like YAML with a linter","Prefer block mappings over { } style for config files","Keep one key/value pair per flow-mapping entry followed by a comma"],"tags":["yaml","parser","flow-style","syntax"],"backgroundTag":"yaml-parse-error","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}