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

specfiles=$(ls | egrep "^[^.]*.(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."
exit $fres