Skip to content

Commit 959fc85

Browse files
committed
fix(kafka): use printf in kafka-rd-schema bats test
dash's echo interprets backslash escapes by default (unlike bash), which mangles double-backslash sequences in the embedded JSON pattern strings and makes jq report an invalid-escape parse error. printf '%s' passes the value through untouched. Signed-off-by: Arsolitt <[email protected]>
1 parent 8d65861 commit 959fc85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎hack/check-kafka-rd-schema.bats‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ COZYRDS="$REPO_ROOT/packages/system/kafka-rd/cozyrds/kafka.yaml"
1010
# The openAPISchema value is a single-line JSON string after "openAPISchema: |-"
1111
SCHEMA_JSON="$(grep -A1 'openAPISchema: |-' "$COZYRDS" | tail -n1 | sed 's/^[[:space:]]*//')"
1212
[ -n "$SCHEMA_JSON" ] || { echo "Could not extract openAPISchema from $COZYRDS" >&2; exit 1; }
13-
echo "$SCHEMA_JSON" | jq -e '.properties.tls.properties.enabled.type == ["boolean", "null"]'
13+
printf '%s' "$SCHEMA_JSON" | jq -e '.properties.tls.properties.enabled.type == ["boolean", "null"]'
1414
}

0 commit comments

Comments
 (0)