.jenkins.sh 307 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/bash

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

fres=0
for i in $specfiles ; do
    echo "-- Validating OpenAPI file $i..."
    swagger-tools validate $i
    res=$?
    fres=$(($fres||$res))
    echo -e "-- Validator returned $res.\n"
done

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

16
exit $fres