Skip to content

Commit b670da2

Browse files
committed
- fix for recursive sdt serialization. Issue 102564
1 parent 98a3969 commit b670da2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dotnet/src/dotnetframework/GxClasses/Helpers/GXRestAPIClient.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,15 @@ public string GetJsonStr(string varName)
247247
public T GetBodySdt<T>(string varName) where T:GxUserType, new()
248248
{
249249
T sdt = new T();
250-
if (_responseData.ContainsKey(varName.ToLower()))
250+
if (_responseData.ContainsKey(varName.ToLower()) && _responseData.Count == 1) //wrapped sdt
251251
{
252252
sdt.FromJSonString(_responseData[varName.ToLower()].ToString(), null);
253253
}
254-
else if (_responseData.Count == 1 && _responseData.ContainsKey(String.Empty))
254+
else if (_responseData.Count == 1 && _responseData.ContainsKey(String.Empty)) // unwrapped
255255
{
256256
sdt.FromJSonString(_responseData[String.Empty].ToString(), null);
257-
}
258-
else if (_responseData.Count >= 1 && !_responseData.ContainsKey(varName.ToLower()))
257+
}
258+
else if (_responseData.Count >= 1) // can contain the same key (recursive unwrapped)
259259
{
260260

261261
#if NETCORE

0 commit comments

Comments
 (0)