Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ExecuteCgibinFreePublishSubmitAsync 解析返回数据的json格式报错了 #136

Closed
DinnerGit opened this issue Apr 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@DinnerGit
Copy link

⚠⚠ 请注意:不符合格式要求的 Issue 可能会被直接关闭。


关于问题的简单描述

ExecuteCgibinFreePublishSubmitAsync 解析返回数据的json格式报错了


与问题相关的源代码

var response = await _client.ExecuteCgibinFreePublishSubmitAsync(request);

异常堆栈或异常原因

  SKIT.FlurlHttpClient.CommonSerializationException: The JSON value could not be converted to System.String. Path: $.msg_data_id | LineNumber: 0 | BytePositionInLine: 75.
   ---> System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $.msg_data_id | LineNumber: 0 | BytePositionInLine: 75.
   ---> System.InvalidOperationException: Cannot get the value of a token type 'Number' as a string.
     at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
     at System.Text.Json.Utf8JsonReader.GetString()
     at System.Text.Json.Serialization.Converters.StringConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
     at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
     at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
     at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
     at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)

发生问题的运行环境

请在此填写以下几项内容:

  1. 操作系统:请填写发生问题的操作系统环境信息(如:Windows Server 2012 R2)
  2. .NET 版本:请填写发生问题的 .NET 环境信息(如:.NET Framework 4.7.2 / .NET 5.0)
  3. 使用的模块及版本:请填写发生问题的模块信息(如:SKIT.FlurlHttpClient.Wechat.Api 1.0.0)
  4. 其他环境信息。

补充说明

请在此填写任何其他可以定位问题的信息。

@DinnerGit DinnerGit added the bug Something isn't working label Apr 25, 2024
@fudiwei fudiwei added the todo Under construction label Apr 25, 2024
@fudiwei
Copy link
Owner

fudiwei commented Apr 25, 2024

可以暂时先指定 JSON 序列化器为 Newtonsoft.Json 规避此错误。后面我会修复此问题。

@fudiwei
Copy link
Owner

fudiwei commented Apr 28, 2024

已修复。将随下一版本 release,敬请留意。

@fudiwei fudiwei closed this as completed Apr 28, 2024
@fudiwei fudiwei removed the todo Under construction label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants