-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsync.sh
More file actions
37 lines (28 loc) · 1.07 KB
/
sync.sh
File metadata and controls
37 lines (28 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -euo pipefail
defaultBaseUrl="https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi"
schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-v4.yaml}"
examplesBaseUrl="${2:-$defaultBaseUrl/examples}"
mkdir -p ./res
curl -fSL -o ./res/fingerprint-server-api.yaml "$schemaUrl"
examplesList=(
'errors/400_ip_address_invalid.json'
'errors/400_request_body_invalid.json'
'errors/403_feature_not_enabled.json'
'errors/404_visitor_not_found.json'
'errors/404_event_not_found.json'
'errors/409_state_not_ready.json'
'errors/429_too_many_requests.json'
'events/get_event_200.json'
'events/search/get_event_search_200.json'
'webhook/webhook_event.json'
)
baseDestination="./src/Fingerprint.ServerSdk.Test/mocks"
for example in "${examplesList[@]}"; do
destinationPath="$baseDestination/$example"
destinationDir="$(dirname "$destinationPath")"
mkdir -p "$destinationDir"
echo "Downloading $example to $destinationPath"
curl -fSL -o "$destinationPath" "$examplesBaseUrl/$example"
done
echo "All OpenAPI documentation downloads complete."