From d1ad7640b765b294c8e9664ef736f0c88b88ea69 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 18 Feb 2026 17:43:18 +0530 Subject: [PATCH 1/3] ci: add workflow to validate specs against Swagger Validator --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8a411069 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + validate-specs: + name: Validate Specs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Validate all specs against Swagger Validator + run: | + set -e + FAILED=0 + PASSED=0 + VALIDATOR_URL="https://validator.swagger.io/validator/debug" + + while IFS= read -r spec_file; do + echo "Validating: $spec_file" + + response=$(curl -s --max-time 30 -X POST \ + -H "Content-Type: application/json" \ + --data @"$spec_file" \ + "$VALIDATOR_URL") + + errors=$(echo "$response" | jq '[.schemaValidationMessages[] | select(.level == "error")] | length' 2>/dev/null || echo "0") + + if [ "$errors" -gt "0" ]; then + echo " FAILED ($errors error(s)):" + echo "$response" | jq -r '.schemaValidationMessages[] | select(.level == "error") | " - \(.message)"' + FAILED=$((FAILED + 1)) + else + echo " PASSED" + PASSED=$((PASSED + 1)) + fi + done < <(find specs -name "*.json" | sort) + + echo "" + echo "Results: $PASSED passed, $FAILED failed" + + if [ "$FAILED" -ne "0" ]; then + echo "One or more specs failed validation." + exit 1 + fi + + echo "All specs passed validation." From dc4443eb7cf2171435922da988163d7b8cdefb8e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 18 Feb 2026 17:45:54 +0530 Subject: [PATCH 2/3] fix: replace broken Twitter badge with X static badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb3de17b..d7086695 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Appwrite Specs [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord) -[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite) +[![X (formerly Twitter)](https://img.shields.io/badge/follow-%40appwrite-00acee?logo=x&style=flat-square)](https://x.com/appwrite) This repository contains the official [Appwrite](https://appwrite.io) API specifications and SDK code examples for all supported versions. From 10a95404eade0643da6de88e4a6c9c95971799b8 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 18 Feb 2026 17:51:19 +0530 Subject: [PATCH 3/3] comments --- .github/workflows/ci.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a411069..5544b788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,13 +20,24 @@ jobs: PASSED=0 VALIDATOR_URL="https://validator.swagger.io/validator/debug" + SPECS=$(find specs -name "*.json" | sort) + + if [ -z "$SPECS" ]; then + echo "Error: no spec files found under specs/" + exit 1 + fi + while IFS= read -r spec_file; do echo "Validating: $spec_file" - response=$(curl -s --max-time 30 -X POST \ + response=$(curl -s --fail-with-body --max-time 30 -X POST \ -H "Content-Type: application/json" \ --data @"$spec_file" \ - "$VALIDATOR_URL") + "$VALIDATOR_URL") || { + echo " FAILED (HTTP/network error)" + FAILED=$((FAILED + 1)) + continue + } errors=$(echo "$response" | jq '[.schemaValidationMessages[] | select(.level == "error")] | length' 2>/dev/null || echo "0") @@ -38,7 +49,7 @@ jobs: echo " PASSED" PASSED=$((PASSED + 1)) fi - done < <(find specs -name "*.json" | sort) + done <<< "$SPECS" echo "" echo "Results: $PASSED passed, $FAILED failed"