{"record":{"id":"2246a2f69c861d56","repo":"tui-cs/Terminal.Gui","slug":"after-propertyname-expected-a-json-property-nam","errorCode":null,"errorMessage":"After {propertyName}: Expected a JSON property name, but got \"{reader.TokenType}\"","messagePattern":"After (.+?): Expected a JSON property name, but got \"(.+?)\"","errorType":"exception","errorClass":"JsonException","httpStatus":null,"severity":"error","filePath":"Terminal.Gui/Configuration/ScopeJsonConverter.cs","lineNumber":50,"sourceCode":"    {\n        if (reader.TokenType != JsonTokenType.StartObject)\n        {\n            throw new JsonException ($$\"\"\"Expected a JSON object (\"{ \"propName\" : ... }\"), but got \"{{reader.TokenType}}\".\"\"\");\n        }\n\n        var scope = (TScopeT)Activator.CreateInstance (typeof (TScopeT))!;\n        var propertyName = string.Empty;\n\n        while (reader.Read ())\n        {\n            if (reader.TokenType == JsonTokenType.EndObject)\n            {\n                return scope!;\n            }\n\n            if (reader.TokenType != JsonTokenType.PropertyName)\n            {\n                throw new JsonException ($\"After {propertyName}: Expected a JSON property name, but got \\\"{reader.TokenType}\\\"\");\n            }\n\n            propertyName = reader.GetString ();\n            reader.Read ();\n\n            // Get the hardcoded property from the TscopeT (e.g. ThemeScope.GetHardCodedProperty)\n            ConfigProperty? configProperty = scope.GetHardCodedProperty (propertyName!);\n\n            if (propertyName is { } && configProperty is { })\n            {\n                // This property name was found in the cached hard-coded scope dict.\n\n                // Add it, with no value\n                configProperty.HasValue = false;\n                configProperty.PropertyValue = null;\n                scope.TryAdd (propertyName, configProperty);\n\n                // Figure out if it needs a JsonConverter and if so, create one","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/Configuration/ScopeJsonConverter.cs#L32-L68","documentation":"Inside a scope object (SettingsScope/ThemeScope), after reading a property value, the next token is not a PropertyName — malformed JSON such as a missing comma, a stray value, or wrong nesting. Mirrors the Scheme-level error 67 but at the Scope level.","triggerScenarios":"A scope object with missing commas, stray tokens, or mis-nested values, e.g. { \"Schemes\": {...} \"Themes\": {...} }.","commonSituations":"Hand-editing config and dropping commas; a templating tool emitting malformed JSON.","solutions":["Run the config through a JSON linter.","Fix missing commas / nesting; ensure flat key:value pairs separated by commas."],"exampleFix":"// before\n{ \"Schemes\": {...} \"Themes\": {...} }\n// after\n{ \"Schemes\": {...}, \"Themes\": {...} }","handlingStrategy":"validation","validationCode":"// Pre-validate JSON syntax\ntry { JsonDocument.Parse (File.ReadAllText (path)); }\ncatch (JsonException ex) { /* missing comma / bad nesting; ex has position */ }","typeGuard":null,"tryCatchPattern":"try { ConfigurationManager.Apply (); }\ncatch (JsonException ex) when (ex.Message.Contains (\"Expected a JSON property name\"))\n{ /* ex.Message names the last propertyName before the error */ }","preventionTips":["Lint JSON before loading.","Use a JSON-aware editor that flags malformed syntax."],"tags":["config","json","scope","syntax"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}