Skip to content

[BUG] Token without expiration parse error #38

@stefano118

Description

@stefano118

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


关于问题的简单描述

On the TikTok Shop, it's possible to request a token without an expiration date, but in this case, JSON parsing fails.


与问题相关的源代码

return await _client.ExecuteAuthGetTokenAsync(new AuthGetTokenRequest
        {
            AuthorizedCode = authorizedCode
        }, cancellationToken);

异常堆栈或异常原因

SKIT.FlurlHttpClient.CommonSerializationException: The JSON value could not be converted to System.Int32. Path: $.data.refresh_token_expire_in | LineNumber: 0 | BytePositionInLine: 369.
---> System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $.data.refresh_token_expire_in | LineNumber: 0 | BytePositionInLine: 369.
---> System.FormatException: Either the JSON value is not in a supported format, or is out of bounds for an Int32.
at System.Text.Json.ThrowHelper.ThrowFormatException(NumericType numericType)
at System.Text.Json.Utf8JsonReader.GetInt32()
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader) at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)

发生问题的运行环境

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

  1. .NET 8
  2. SKIT.FlurlHttpClient.ByteDance.TikTokGlobalShop 3.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtodo

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions