Skip to content

Commit

Permalink
Validate OpenAPI when generating
Browse files Browse the repository at this point in the history
Closes #502
  • Loading branch information
masokol committed Jul 31, 2023
1 parent 4d64a9a commit 7e244db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ecchronos-binary/src/test/bin/pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,21 @@ else
--define cql_client_key="$CERTIFICATE_DIRECTORY/key.pem" \
--define cql_client_ca="$CERTIFICATE_DIRECTORY/ca.crt"
fi
RETURN=$?
TEST_RETURN_CODE=$?

echo "Fetching OpenAPI spec"
pip install openapi-spec-validator
if [ "${LOCAL}" == "true" ]; then
curl http://localhost:8080/v3/api-docs.yaml -o ../../../docs/autogenerated/openapi.yaml
else
curl https://localhost:8080/v3/api-docs.yaml -o ../../../docs/autogenerated/openapi.yaml --cert $CERTIFICATE_DIRECTORY/clientcert.crt --key $CERTIFICATE_DIRECTORY/clientkey.pem --cacert $CERTIFICATE_DIRECTORY/serverca.crt
fi
openapi-spec-validator ../../../docs/autogenerated/openapi.yaml --schema 3.0.0
OPENAPI_RETURN_CODE=$?

if [ -f $PIDFILE ]; then
cd -
bin/ecctool stop -p $PIDFILE
fi

exit $RETURN
! (( TEST_RETURN_CODE || $OPENAPI_RETURN_CODE ))

0 comments on commit 7e244db

Please sign in to comment.