在 C# 中 Json 序列化中的 Shippo 跟踪 FeDex 错误

Shippo Tracking FeDex Error in Json Serialization in C#

我试图在 Visual Studio(C#) 中使用项目 ShippingTesting。我尝试了 UPS,效果很好。
但是当我尝试 FeDex 时,它抛出了一条错误消息:

"Newtonsoft.Json.JsonSerializationException", " Additional information: Error converting value "PRE_TRANSIT" to type 'Shippo.ShippoEnums+TrackingStatus'. Path 'tracking_history[0].status',"

看起来像是 JSON 序列化问题。这会是 Fedex 经常遇到的问题吗?
谢谢!

'PRE_TRANSIT' 已添加为最新版本的 API 中的可能状态(它取代了旧的初始 'UNKNOWN' 状态,用于标签已创建但尚未创建进入过境)。

可能需要更新 C# 库以支持此附加映射。作为解决方法,您可以在请求的 header 中传递旧的 API 版本('2018-02-08' 之前),这应该 return 旧的 'UNKNOWN'映射。

参考:https://goshippo.com/docs/changelog