From 0be834a7433525d716f20c731447d851b0658b07 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Thu, 22 Oct 2026 10:10:44 +0200 Subject: [PATCH] build: ignore key order when verifying openapi specs Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/verify-openapi.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-openapi.yml b/.github/workflows/verify-openapi.yml index 501d533..2a163c9 100644 --- a/.github/workflows/verify-openapi.yml +++ b/.github/workflows/verify-openapi.yml @@ -53,7 +53,11 @@ jobs: ./gradlew mergeOpenApiSpec --inputDir=${PWD}/resources/openapi/yaml/${{ matrix.apiGroup }} --output=${{ matrix.apiGroup }}-new.yaml --infoTitle="${{ matrix.apiGroup }}" --infoDescription="REST API documentation for the ${{ matrix.apiGroup }}" --infoVersion=$VERSION git show origin/gh-pages:openapi/${{ matrix.apiGroup }}/${{ matrix.apiGroup }}.yaml > ${{ matrix.apiGroup }}.yaml - + + # the merged spec has no stable key order (e.g. of paths), so keys are sorted before comparing + yq -i -P 'sort_keys(..)' ${{ matrix.apiGroup }}.yaml + yq -i -P 'sort_keys(..)' ${{ matrix.apiGroup }}-new.yaml + diff ${{ matrix.apiGroup }}.yaml ${{ matrix.apiGroup }}-new.yaml > diff || true echo "diff with the current version"