Skip to content

Commit 221449d

Browse files
Set WriteIndented=true for M.E.AI logging / telemetry / etc. (#5497)
2 parents defa6c1 + 1b64e76 commit 221449d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Libraries/Microsoft.Extensions.AI/JsonDefaults.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ private static JsonSerializerOptions CreateDefaultOptions()
3030
// Keep in sync with the JsonSourceGenerationOptions on JsonContext below.
3131
var options = new JsonSerializerOptions(JsonSerializerDefaults.Web)
3232
{
33+
WriteIndented = true,
3334
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
3435
TypeInfoResolver = new DefaultJsonTypeInfoResolver(),
3536
};
@@ -44,7 +45,7 @@ private static JsonSerializerOptions CreateDefaultOptions()
4445
}
4546

4647
// Keep in sync with CreateDefaultOptions above.
47-
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
48+
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web, WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
4849
[JsonSerializable(typeof(IList<ChatMessage>))]
4950
[JsonSerializable(typeof(ChatOptions))]
5051
[JsonSerializable(typeof(EmbeddingGenerationOptions))]

0 commit comments

Comments
 (0)