Interfaces/GraphQL: Improve debugging
This commit is contained in:
@@ -118,6 +118,30 @@ Public Class GraphQLInterface
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ReadJSONPathFragmented(pObject As Linq.JObject, pJsonPath As String)
|
||||
Dim oSplitPath As List(Of String) = pJsonPath.Split(".").ToList()
|
||||
Dim oCurrentPath As String = String.Empty
|
||||
|
||||
For Each oPart In oSplitPath
|
||||
If oCurrentPath = String.Empty Then
|
||||
oCurrentPath = oPart
|
||||
Else
|
||||
oCurrentPath &= "." & oPart
|
||||
End If
|
||||
|
||||
_logger.Debug("Selecting Path Fragment [{0}]", oCurrentPath)
|
||||
|
||||
Try
|
||||
pObject.SelectToken(oCurrentPath, errorWhenNoMatch:=True)
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Path Fragment [{0}] did not return a valid token", oCurrentPath)
|
||||
Return False
|
||||
End Try
|
||||
Next
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function GetRequest(Url As String, PostData As Byte()) As HttpWebRequest
|
||||
Try
|
||||
Dim oRequest As HttpWebRequest = WebRequest.Create($"{_baseUrl}{Url}")
|
||||
|
||||
Reference in New Issue
Block a user