ardalis / ardalis/HttpClientTestExtensions

Allow to modify the JsonSerializerOptions

未关闭
#41 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
107
派生
24
PR 合并指标
30 天内没有已合并 PR

描述

Could we provide a way to change the default json options of JsonSerializer?
```
public static async Task GetAndDeserializeAsync(this HttpClient client, string requestUri, ITestOutputHelper output = null)
{
HttpResponseMessage obj = await client.GetAsync(requestUri, output);
obj.EnsureSuccessStatusCode();
string text = await obj.Content.ReadAsStringAsync();
output?.WriteLine("Response: " + text);
return JsonSerializer.Deserialize(text, Constants.DefaultJsonOptions);
}
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 GetAndDeserializeAsync 开始,跟踪 Constants.DefaultJsonOptions,以了解默认设置在哪里应用。确定调用方应如何提供或更改 JsonSerializerOptions,然后验证反序列化使用这些选项,同时不破坏现有的默认行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
testing
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。