Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/RestHelpers.bas
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,17 @@ Private Function json_parseObject(ByRef str As String, ByRef index As Long) As O
Dim Key As String

' add key/value pair
json_parseObject.Add Key:=json_parseKey(str, index), Item:=json_parseValue(str, index)

'// Next line commented out as it throws error if key is repeated which is still valid json
'json_parseObject.Add Key:=json_parseKey(str, index), Item:=json_parseValue(str, index)

'// The purpose of this fix is to test for key existence before adding so parser doesen't throw an error
' which would cause the intended RestResponse.Data object to be 'nothing'
currentKey = json_parseKey(str, index)
currentItem = json_parseValue(str, index)

If Not json_parseObject.Exists(currentKey) Then json_parseObject.Add Key:=currentKey, Item:=currentItem

Loop

End Function
Expand Down