{"record":{"id":"d4fe8e1a06695dbf","repo":"iOfficeAI/OfficeCLI","slug":"expected-property-name","errorCode":null,"errorMessage":"Expected property name","messagePattern":"Expected property name","errorType":"validation","errorClass":"JsonException","httpStatus":null,"severity":"warning","filePath":"src/officecli/BatchTypes.cs","lineNumber":41,"sourceCode":"        {\n            while (reader.Read())\n            {\n                if (reader.TokenType == JsonTokenType.EndArray) return dict;\n                if (reader.TokenType != JsonTokenType.String)\n                    throw new JsonException(\"Expected \\\"key=value\\\" string in props array\");\n                var kv = reader.GetString()!;\n                var eq = kv.IndexOf('=');\n                if (eq > 0) dict[kv[..eq]] = kv[(eq + 1)..];  // skip malformed, as ParseProps does\n            }\n            throw new JsonException(\"Unexpected end of JSON\");\n        }\n        if (reader.TokenType != JsonTokenType.StartObject)\n            throw new JsonException(\"Expected object or [\\\"key=value\\\"] array for props\");\n        while (reader.Read())\n        {\n            if (reader.TokenType == JsonTokenType.EndObject) return dict;\n            if (reader.TokenType != JsonTokenType.PropertyName)\n                throw new JsonException(\"Expected property name\");\n            var key = reader.GetString()!;\n            reader.Read();\n            var value = reader.TokenType switch\n            {\n                JsonTokenType.String => reader.GetString()!,\n                JsonTokenType.Number => reader.TryGetInt64(out var l) ? l.ToString() : reader.GetDouble().ToString(),\n                JsonTokenType.True => \"true\",\n                JsonTokenType.False => \"false\",\n                JsonTokenType.Null => \"\",\n                _ => throw new JsonException($\"Unexpected token {reader.TokenType} for prop value '{key}'\")\n            };\n            dict[key] = value;\n        }\n        throw new JsonException(\"Unexpected end of JSON\");\n    }\n\n    public override void Write(Utf8JsonWriter writer, Dictionary<string, string> value, JsonSerializerOptions options)\n    {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/BatchTypes.cs#L23-L59","documentation":"JsonException from LenientStringDictionaryConverter.Read inside the OBJECT branch: after reading a value and looping, the next token was not a PropertyName (e.g. a value token appeared where a property name was expected). This indicates a structurally malformed props object, not a value-type problem.","triggerScenarios":"A props object like {\"a\":1 2} (a number where the next key should be), {\"a\":\"b\" \"c\"} (two strings in a row), or any object whose key/value pairing is broken.","commonSituations":"Hand-edited or templated JSON with a missing key or extra value; a serializer bug that emitted values back-to-back.","solutions":["Re-emit props with a real JSON serializer so key/value pairing is guaranteed.","Run the full batch through a JSON validator/linter before sending.","Confirm every props entry is \"key\": value, comma-separated."],"exampleFix":"// before: props: { \"text\": \"hi\" \"count\" }   // malformed (missing value)\n// after:  props: { \"text\": \"hi\", \"count\": \"3\" }","handlingStrategy":"validation","validationCode":"// Structural pre-check: every props entry must be a string scalar value\nfunction wellFormedPropsObject(p) {\n  if (p == null || typeof p !== 'object' || Array.isArray(p)) return false;\n  return Object.entries(p).every(([k, v]) => typeof k === 'string' && ['string','number','boolean'].includes(typeof v));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always serialize props with JSON.stringify so key/value pairing is enforced.","Lint batch JSON before sending.","Avoid hand-editing batch item JSON."],"tags":["batch","json","props","malformed","deserialization"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}