Skip to content

Commit

Permalink
Add elements operator to Synthetics Tests JSON Path assertion (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
elx-bob authored Dec 2, 2024
1 parent 0c7926a commit 7d63b7a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions modules/synthetics/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ resource "datadog_synthetics_test" "default" {
for_each = assertion.value.operator == "validatesJSONPath" ? [lookup(assertion.value, "targetjsonpath", lookup(assertion.value, "target", null))] : []

content {
jsonpath = lookup(targetjsonpath.value, "jsonpath", lookup(targetjsonpath.value, "jsonPath", null))
operator = targetjsonpath.value.operator
targetvalue = lookup(targetjsonpath.value, "targetvalue", lookup(targetjsonpath.value, "targetValue", null))
jsonpath = lookup(targetjsonpath.value, "jsonpath", lookup(targetjsonpath.value, "jsonPath", null))
elementsoperator = lookup(targetjsonpath.value, "elementsoperator", lookup(targetjsonpath.value, "elementsOperator", null))
operator = targetjsonpath.value.operator
targetvalue = lookup(targetjsonpath.value, "targetvalue", lookup(targetjsonpath.value, "targetValue", null))
}
}

Expand Down Expand Up @@ -199,9 +200,10 @@ resource "datadog_synthetics_test" "default" {
for_each = assertion.value.operator == "validatesJSONPath" ? [lookup(assertion.value, "targetjsonpath", lookup(assertion.value, "target", null))] : []

content {
jsonpath = lookup(targetjsonpath.value, "jsonpath", lookup(targetjsonpath.value, "jsonPath", null))
operator = targetjsonpath.value.operator
targetvalue = lookup(targetjsonpath.value, "targetvalue", lookup(targetjsonpath.value, "targetValue", null))
jsonpath = lookup(targetjsonpath.value, "jsonpath", lookup(targetjsonpath.value, "jsonPath", null))
elementsoperator = lookup(targetjsonpath.value, "elementsoperator", lookup(targetjsonpath.value, "elementsOperator", null))
operator = targetjsonpath.value.operator
targetvalue = lookup(targetjsonpath.value, "targetvalue", lookup(targetjsonpath.value, "targetValue", null))
}
}

Expand Down

0 comments on commit 7d63b7a

Please sign in to comment.