C# 10 / .NET 6 / System.Text.Json
我正在使用一个以 JSON 响应形式返回的 API。我正在尝试System.Text.Json将 JSON 响应反序列化为一个类。我收到 JsonException 并可以帮助理解我做错了什么。
我调用 API 并存储 JSON 响应:
string json = await Retreive.Fetch(target);
这是输出Console.WriteLine(json):
[{"id": 1148082,"name": "TestGroup","group_type":"console_group","provisioning_guid": null,"member_count": 1,"current_risk_score": 36.3,"status": "active"},{"id": 1148788,"name": "Group2","group_type": "smart_group","provisioning_guid": null,"member_count": 9,"current_risk_score": 39.7,"status": "active"},{"id": 1148792,"name": "Group3","group_type": "smart_group","provisioning_guid": null,"member_count": 9,"current_risk_score": 39.7,"status": "active"}]
Run Code Online (Sandbox Code Playgroud)
如果有帮助的话,这是一个漂亮的印刷版本:
[
{
"id": 1148082,
"name": "TestGroup",
"group_type": "console_group",
"provisioning_guid": null,
"member_count": 1,
"current_risk_score": 36.3,
"status": "active"
},
{
"id": 1148788,
"name": "Group2",
"group_type": "smart_group",
"provisioning_guid": null,
"member_count": 9, …Run Code Online (Sandbox Code Playgroud) git 版本 2.41.0.windows.2
PowerShell 版本 7.3.5
当我运行时git credential-manager github list,凭据管理器会显示同一帐户两次:
PS C:\Users\<redacted>\dev\src\cs\<redacted> git credential-manager github list
chrisxfire
chrisxfire
Run Code Online (Sandbox Code Playgroud)
我可以通过运行删除重复的帐户git credential-manager github logout chrisxfire。但是,一旦我打开另一个存储库,重复的帐户就会再次出现。
知道是什么原因造成的或如何永久修复它吗?