github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/hack/validate-fixtures.sh (about)

     1  #!/bin/bash
     2  # Run a spec validation on fixtures
     3  
     4  cd $(git rev-parse --show-toplevel)
     5  FIXTURES="${basedir}/fixtures"
     6  
     7  if ! command -v swagger >/dev/null 2>&1; then
     8    echo "can't find swagger in the PATH"
     9    exit 1
    10  fi
    11  
    12  find "${FIXTURES}" -type f \( \( -name \*.json -o -name \.yaml -o -name \*.yml \)  -a -not -name \*codegen\* \) |\
    13  while read -r spec
    14  do
    15      swagger validate "${spec}" --skip-warnings --stop-on-error
    16  done