diff --git a/.gitignore b/.gitignore index 3546253..58f4257 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ Thumbs.db test-results/ playwright-report/ playwright/.cache/ +.checkly_openapi_tmp.json diff --git a/update-api-spec.sh b/update-api-spec.sh index e9b9c12..8bc568e 100755 --- a/update-api-spec.sh +++ b/update-api-spec.sh @@ -6,7 +6,7 @@ set -e LIVE_API_URL="https://api.checklyhq.com/openapi.json" API_SPEC_PATH="./api-reference/openapi.json" -TEMP_FILE="/tmp/checkly_openapi.json" +TEMP_FILE="./.checkly_openapi_tmp.json" echo "📥 Fetching live API specification from $LIVE_API_URL..." curl -s "$LIVE_API_URL" > "$TEMP_FILE" @@ -16,6 +16,11 @@ if [ ! -s "$TEMP_FILE" ]; then exit 1 fi +echo "🔧 Fixing invalid OpenAPI schema fields..." +# Fix maxPacketLossThreshold.minimum which contains a Joi.ref() object instead of a number +jq '.components.schemas.IcmpMonitorCreate.properties.maxPacketLossThreshold.minimum = 0 + | .components.schemas.IcmpMonitorUpdate.properties.maxPacketLossThreshold.minimum = 0' "$TEMP_FILE" > "${TEMP_FILE}.fixed" && mv "${TEMP_FILE}.fixed" "$TEMP_FILE" + echo "🔧 Cleaning up HTML in descriptions..." # Convert common HTML tags to Markdown # Order matters: convert first so patterns work on remaining content