Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Most files in the project are autogenerated by [swagger-codegen](https://swagger
You need `swagger-codegen` to run code generation. There are many ways described in the [readme](https://github.com/swagger-api/swagger-codegen).
In the project we use Docker image `swaggerapi/swagger-codegen-cli-v3` for code generation.

You can just run `sh ./scripts/generate.sh` script and it will do all the work.
You can just run `./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`

## Creating Coverage Report (Markdown and HTML)

Expand Down
15 changes: 8 additions & 7 deletions scripts/sync.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#!/bin/bash
#!/usr/bin/env bash

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

defaultBaseUrl="https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi"
schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-compact.yaml}"
schemaUrl="${1:-https://fingerprintjs.github.io/openapi/schemas/fingerprint-server-api-compact.yaml}"

mkdir -p ./res

CURL_OPTS=(-fSL --retry 3)
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

require_cmd curl

echo "Downloading \`$schemaUrl\`..."
echo "Downloading $schemaUrl"
curl "${CURL_OPTS[@]}" -o ./res/fingerprint-server-api.yaml "$schemaUrl"

echo "OpenAPI schema download complete."

# Add `deprecated: true` for component schemas
echo "Adding deprecation for component schemas..."
docker run --rm -v "${PWD}:/work" python:3-alpine sh -c \
Expand Down
Loading