diff --git a/.github/workflows/suite.sh b/.github/workflows/suite.sh new file mode 100755 index 000000000..32fd03078 --- /dev/null +++ b/.github/workflows/suite.sh @@ -0,0 +1,779 @@ +#!/bin/bash -eu + +set -o pipefail + +OAI_COMMIT=${OAI_COMMIT:-157a4c81ae537ef793b2bee368bc00d88b461de8} # On 2022-10-17 +OAI_SLUG=OAI-OpenAPI-Specification +OAI_DIR=$OAI_SLUG-${OAI_COMMIT:0:7}/examples + +if ! [[ -d $OAI_DIR ]]; then + curl -fSLo $OAI_SLUG.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"$OAI_COMMIT" + tar zxf $OAI_SLUG.tar.gz + rm $OAI_SLUG.tar.gz +fi + +APISGURU_COMMIT=${APISGURU_COMMIT:-226773819e337e6c413d1be91b26b33111211768} # On 2022-10-17 +APISGURU_SLUG=APIs-guru-openapi-directory +APISGURU_DIR=$APISGURU_SLUG-${APISGURU_COMMIT:0:7}/APIs + +if ! [[ -d $APISGURU_DIR ]]; then + curl -fSLo $APISGURU_SLUG.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"$APISGURU_COMMIT" + tar zxf $APISGURU_SLUG.tar.gz + rm $APISGURU_SLUG.tar.gz +fi +# Ignore documents that are too large / take too long +rm -f $APISGURU_DIR/microsoft.com/graph/beta/openapi.yaml # >30MB +rm -f $APISGURU_DIR/microsoft.com/graph/v1.0/openapi.yaml # >15MB + +cat <=1.15) + uses: actions/cache@v3 + with: + path: \${{ steps.go-cache-paths.outputs.go-mod }} + key: \${{ runner.os }}-go-\${{ matrix.go }}-mod-\${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: \${{ runner.os }}-go-\${{ matrix.go }}-suite-\${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d $OAI_DIR ]]; then + curl -fSLo $OAI_SLUG.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"$OAI_COMMIT" + tar zxf $OAI_SLUG.tar.gz + rm $OAI_SLUG.tar.gz + ls -lha $OAI_DIR + fi + if ! [[ -d $APISGURU_DIR ]]; then + curl -fSLo $APISGURU_SLUG.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"$APISGURU_COMMIT" + tar zxf $APISGURU_SLUG.tar.gz + rm $APISGURU_SLUG.tar.gz + ls -lha $APISGURU_DIR + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f $APISGURU_DIR/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f $APISGURU_DIR/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "$gen" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 $args "\$file" || echo "\$file" >>_ + done < <($gen) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "ls OAI-OpenAPI-Specification-157a4c8/examples/v2.0/json/*.json OAI-OpenAPI-Specification-157a4c8/examples/v2.0/json/petstore-separate/spec/swagger.json" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(ls OAI-OpenAPI-Specification-157a4c8/examples/v2.0/json/*.json OAI-OpenAPI-Specification-157a4c8/examples/v2.0/json/petstore-separate/spec/swagger.json) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "ls OAI-OpenAPI-Specification-157a4c8/examples/v2.0/yaml/*.yaml OAI-OpenAPI-Specification-157a4c8/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(ls OAI-OpenAPI-Specification-157a4c8/examples/v2.0/yaml/*.yaml OAI-OpenAPI-Specification-157a4c8/examples/v2.0/yaml/petstore-separate/spec/swagger.yaml) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find OAI-OpenAPI-Specification-157a4c8/examples/v3.0 -type f | sort" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(find OAI-OpenAPI-Specification-157a4c8/examples/v3.0 -type f | sort) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find OAI-OpenAPI-Specification-157a4c8/examples/v3.1 -type f | sort" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(find OAI-OpenAPI-Specification-157a4c8/examples/v3.1 -type f | sort) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name swagger.yaml | sort | grep -F azure.com | grep -F network" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name swagger.yaml | sort | grep -F azure.com | grep -F network) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name swagger.yaml | sort | grep -F azure.com | grep -vF network" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name swagger.yaml | sort | grep -F azure.com | grep -vF network) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name swagger.yaml | sort | grep -vF azure.com" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name swagger.yaml | sort | grep -vF azure.com) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F adyen" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F adyen) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F amazonaws" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F amazonaws) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F apideck" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F apideck) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F apisetu" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F apisetu) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F docusign" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F docusign) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F dracoon" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F dracoon) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F ebay" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F ebay) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F github" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F github) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F google" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F google) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F here" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F here) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F interzoid" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F interzoid) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F loket" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F loket) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F microsoft" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F microsoft) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F nexmo" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F nexmo) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F pandascore" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F pandascore) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F sportsdata" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F sportsdata) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F stripe" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F stripe) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F telnyx" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F telnyx) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F twilio" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F twilio) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F zoom" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F zoom) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F zuora" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -F zuora) + + - name: Compare with expected results + run: | + cat >__ <=1.15) + uses: actions/cache@v3 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-${{ matrix.go }}-mod-${{ hashFiles('**/go.sum') }} + + - uses: actions/checkout@v2 + + - name: Test suite fixtures cache + uses: actions/cache@v3 + with: + path: | + APIs-guru-openapi-directory-* + OAI-OpenAPI-Specification-* + key: ${{ runner.os }}-go-${{ matrix.go }}-suite-${{ hashFiles('.github/workflows/suite.sh') }} + + - name: Maybe fetch fixtures + run: | + if ! [[ -d OAI-OpenAPI-Specification-157a4c8/examples ]]; then + curl -fSLo OAI-OpenAPI-Specification.tar.gz https://github.com/OAI/OpenAPI-Specification/tarball/"157a4c81ae537ef793b2bee368bc00d88b461de8" + tar zxf OAI-OpenAPI-Specification.tar.gz + rm OAI-OpenAPI-Specification.tar.gz + ls -lha OAI-OpenAPI-Specification-157a4c8/examples + fi + if ! [[ -d APIs-guru-openapi-directory-2267738/APIs ]]; then + curl -fSLo APIs-guru-openapi-directory.tar.gz https://github.com/APIs-guru/openapi-directory/tarball/"226773819e337e6c413d1be91b26b33111211768" + tar zxf APIs-guru-openapi-directory.tar.gz + rm APIs-guru-openapi-directory.tar.gz + ls -lha APIs-guru-openapi-directory-2267738/APIs + fi + + - name: Ignore documents that are too large / take too long + run: | + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/beta/openapi.yaml # >30MB + rm -f APIs-guru-openapi-directory-2267738/APIs/microsoft.com/graph/v1.0/openapi.yaml # >15MB + + - name: Build the tool + run: go build -o . ./cmd/validate + + - name: "find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -vE '|adyen|amazonaws|apideck|apisetu|docusign|dracoon|ebay|github|google|here|interzoid|loket|microsoft|nexmo|pandascore|sportsdata|stripe|telnyx|twilio|zoom|zuora'" + run: | + set -x + touch _ + while read -r file; do + time ./validate -n 99 --patterns=false "$file" || echo "$file" >>_ + done < <(find APIs-guru-openapi-directory-2267738/APIs -type f -name openapi.yaml | sort | grep -vE '|adyen|amazonaws|apideck|apisetu|docusign|dracoon|ebay|github|google|here|interzoid|loket|microsoft|nexmo|pandascore|sportsdata|stripe|telnyx|twilio|zoom|zuora') + + - name: Compare with expected results + run: | + cat >__ <\nGot: %+v\n", os.Args) } + n := *argN + if n <= 0 { + n = 1 + } + data, err := os.ReadFile(filename) if err != nil { log.Fatal(err) } - var vd struct { OpenAPI string `json:"openapi" yaml:"openapi"` Swagger string `json:"swagger" yaml:"swagger"` @@ -57,6 +63,7 @@ func main() { log.Fatal(err) } + var realErr error switch { case vd.OpenAPI == "3" || strings.HasPrefix(vd.OpenAPI, "3."): openapi3.CircularReferenceCounter = *circular @@ -73,6 +80,16 @@ func main() { log.Fatalln("Loading error:", err) } + for range make([]struct{}, n) { + if doc, err = loader.LoadFromFile(filename); err == nil { + break + } + realErr = err + } + if err = realErr; err != nil { + log.Fatalln("Loading error:", err) + } + var opts []openapi3.ValidationOption if !*defaults { opts = append(opts, openapi3.DisableSchemaDefaultsValidation()) @@ -84,7 +101,13 @@ func main() { opts = append(opts, openapi3.DisableSchemaPatternValidation()) } - if err = doc.Validate(loader.Context, opts...); err != nil { + for range make([]struct{}, n) { + if err = doc.Validate(loader.Context, opts...); err == nil { + break + } + realErr = err + } + if err = realErr; err != nil { log.Fatalln("Validation error:", err) } @@ -107,7 +130,13 @@ func main() { } var doc openapi2.T - if err := yaml.Unmarshal(data, &doc); err != nil { + for range make([]struct{}, n) { + if err := yaml.Unmarshal(data, &doc); err == nil { + break + } + realErr = err + } + if err = realErr; err != nil { log.Fatalln("Loading error:", err) }