.jenkins.sh 374 Bytes
Newer Older
Elian Kraja's avatar
Elian Kraja committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash

specfiles=$(ls | egrep "^[^.]*.(json|yaml)")

fres=0
for i in $specfiles ; do
    echo "-- Validating and linting OpenAPI file $i..."
    swagger-cli validate $i
    res=$?
    speccy lint "$i"
    res2=$?
    fres=$(($fres||$res||$res2))
    echo "--- Validator returned $res, linter returned $res2."
done

echo "-- Final validator returns $fres."
exit $fres