#!/usr/bin/env bash # What a RestClient caller can decode from each error body. -> docs/output/client-decoding.txt set -uo pipefail source "$(dirname "$0")/env.sh" { for profile in advice ""; do "$MODULE_DIR/scripts/run.sh" "$profile" || exit 1 echo "# Profile: ${profile:-defaults}" echo for path in /orders/999 '/orders?limit=500' /orders/boom; do echo "## RestClient GET $path -> ex.getResponseBodyAs(ProblemDetail.class)" curl -s -G "$BASE/diag/decode" --data-urlencode "path=$path" | python3 -m json.tool echo done done echo "# ProblemDetail with one extension member, serialised three ways" "$MODULE_DIR/scripts/run.sh" advice || exit 1 curl -s "$BASE/diag/mixin" | python3 -m json.tool } > "$OUT/client-decoding.txt" "$MODULE_DIR/scripts/stop.sh" cat "$OUT/client-decoding.txt"