From e3e97f2bbe23947c3aa9790e2c3e599b9a3418ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Thu, 24 Sep 2026 21:13:15 +0300 Subject: [PATCH 1/2] chore: update schema URL and harden sync script Update OpenAPI schema URL in the sync script. Use `env bash` shebang, so the script picks up bash from the correct environment. Resolve paths relative to the repository root. Harden `curl` with retry transient failures, refuse redirects that leave https and bound connect and transfer time so a stalled download cannot hang CI or local. Log the full URL being fetched, so it is clear which base URL a run actually used. Related-Task: INTER-2472 --- scripts/sync.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/sync.sh b/scripts/sync.sh index 2d397a0..a2fcbe5 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -1,10 +1,25 @@ -#!/bin/bash +#!/usr/bin/env bash +set -euo pipefail -set -ex +# Resolve paths relative to the repository root, so the script can be run from +# any working directory. +cd "$(dirname "${BASH_SOURCE[0]}")/.." + +schemaUrl="${1:-https://fingerprintjs.github.io/openapi/schemas/fingerprint-server-api-compact.yaml}" + +CURL_OPTS=(-fSL --retry 3 --proto-redir '=https' --connect-timeout 10 --max-time 300) +if [[ "${TRACE:-}" != "true" && "${ACTIONS_STEP_DEBUG:-}" != "true" ]]; then + CURL_OPTS+=(-s) +fi + +mkdir -p ./res # Download latest schema. Examples are no longer published at the upstream URL # (fingerprintjs.github.io/.../examples/ returns 404). Mock files in # sdk/src/test/resources/mocks/ are maintained locally. -curl -fsSL -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-compact.yaml +echo "Downloading $schemaUrl" +curl "${CURL_OPTS[@]}" -o ./res/fingerprint-server-api.yaml "$schemaUrl" + +echo "OpenAPI schema download complete." ./scripts/generate.sh From 6098aa7d1d06758d54a4b58f1bb2f913723d8bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Thu, 24 Sep 2026 21:23:54 +0300 Subject: [PATCH 2/2] docs: execute sync script directly instead of dash or sh --- contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing.md b/contributing.md index e0a5576..f588766 100644 --- a/contributing.md +++ b/contributing.md @@ -16,7 +16,7 @@ In the project we use local jar file `bin/generator.jar`. You can just run `sh ./scripts/generate.sh` script and it will do all the work. -To download fresh OpenAPI schema run `sh ./scripts/sync.sh` +To download fresh OpenAPI schema run `./scripts/sync.sh` ### Testing the local source code of the SDK