export and auto-commit docs/docs/api/openapi.json as part of test-api-contract workflow (#719)

- copies that openapi.json file to docs/docs/api/openapi.json as part of start-mock-server.sh.
- adds a step to the end of the test-api-contract workflow that just auto-commits changes to the docs/docs/api/openapi.json file.
- excludes docs/docs/api/openapi.json from pre-commit since its already been formatted by jq.
This commit is contained in:
Andrew Maguire
2023-01-14 22:40:33 +00:00
committed by GitHub
parent 885065adec
commit 0f607c7a28
7 changed files with 1712 additions and 309 deletions
@@ -11,6 +11,9 @@ echo "Generating OpenAPI schema..."
python -m main --print-openapi-schema > $OPENAPI_JSON_FILE_NAME
echo "Done!"
echo "Formatting & Copying OpenAPI schema to docs directory..."
jq . $OPENAPI_JSON_FILE_NAME > ../docs/docs/api/openapi.json
# If oasst-mock-backend docker container is already running,
# just restart it
if [ "$(docker ps -q -f name=oasst-mock-backend)" ]; then