Fixed JSON parser(s)
This commit is contained in:
@@ -370,13 +370,13 @@ type ExecutionRequestWrapper struct {
|
||||
}
|
||||
|
||||
type AppExecutionExample struct {
|
||||
AppName string `json:"app_name"`
|
||||
AppVersion string `json:"app_version"`
|
||||
AppAction string `json:"app_action"`
|
||||
AppId string `json:"app_id"`
|
||||
ExampleId string `json:"example_id"`
|
||||
SuccessExamples []string `json:"success_examples"`
|
||||
FailureExamples []string `json:"failure_examples"`
|
||||
AppName string `json:"app_name" datastore:"app_name"`
|
||||
AppVersion string `json:"app_version" datastore:"app_version"`
|
||||
AppAction string `json:"app_action" datastore:"app_action"`
|
||||
AppId string `json:"app_id" datastore:"app_id"`
|
||||
ExampleId string `json:"example_id" datastore:"example_id"`
|
||||
SuccessExamples []string `json:"success_examples" datastore:"success_examples,noindex"`
|
||||
FailureExamples []string `json:"failure_examples" datastore:"failure_examples,noindex"`
|
||||
}
|
||||
|
||||
// This might be... a bit off, but that's fine :)
|
||||
|
||||
@@ -2531,14 +2531,16 @@ const AngularWorkflow = (props) => {
|
||||
|
||||
foundResult.result = foundResult.result.trim()
|
||||
foundResult.result = foundResult.result.split(" None").join(" \"None\"")
|
||||
foundResult.result = foundResult.result.split(" False").join(" false")
|
||||
foundResult.result = foundResult.result.split(" True").join(" true")
|
||||
foundResult.result = foundResult.result.split("\'").join("\"")
|
||||
|
||||
var jsonvalid = true
|
||||
try {
|
||||
const tmp = String(JSON.parse(foundResult.result))
|
||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
jsonvalid = false
|
||||
}
|
||||
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
// jsonvalid = false
|
||||
//}
|
||||
} catch (e) {
|
||||
jsonvalid = false
|
||||
}
|
||||
@@ -2625,9 +2627,9 @@ const AngularWorkflow = (props) => {
|
||||
var jsonvalid = true
|
||||
try {
|
||||
const tmp = String(JSON.parse(actionItem.example))
|
||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
jsonvalid = false
|
||||
}
|
||||
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
// jsonvalid = false
|
||||
//}
|
||||
} catch (e) {
|
||||
jsonvalid = false
|
||||
}
|
||||
@@ -5344,13 +5346,15 @@ const AngularWorkflow = (props) => {
|
||||
var showResult = executionData.execution_argument.trim()
|
||||
showResult = showResult.split(" None").join(" \"None\"")
|
||||
showResult = showResult.split("\'").join("\"")
|
||||
showResult = showResult.split(" False").join(" false")
|
||||
showResult = showResult.split(" True").join(" true")
|
||||
|
||||
var jsonvalid = true
|
||||
try {
|
||||
const tmp = String(JSON.parse(showResult))
|
||||
if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
jsonvalid = false
|
||||
}
|
||||
//if (!tmp.includes("{") && !tmp.includes("[")) {
|
||||
// jsonvalid = false
|
||||
//}
|
||||
} catch (e) {
|
||||
jsonvalid = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user