-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26fdd87
commit 5f3d035
Showing
5 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
cd ../docs | ||
|
||
OPENAPI_JSON="../docs/openapi.json" | ||
OPENAPI_JSON_BACKUP="../docs/openapi_backup.json" | ||
|
||
# Download the latest openapi.json | ||
curl http://localhost:8080/openapi.json > $OPENAPI_JSON_BACKUP | ||
|
||
# Compare the 'paths' key of both JSON files directly | ||
if cmp -s <(jq '.paths' "$OPENAPI_JSON") <(jq '.paths' "$OPENAPI_JSON_BACKUP"); then | ||
echo "API docs are up-to-date." | ||
else | ||
echo "🔴🔴🔴 API docs are not up-to-date. 🔴🔴🔴" | ||
echo "The 'paths' sections in openapi.json is not up-to-date with http://localhost:8080/openapi.json." | ||
echo "Most probably it means that the API was updated, and the API docs should be regenerated." | ||
echo "Please run the following command to regenerate the API docs: ./scripts/docs_generate_api_docs_from_openapi.sh" | ||
exit 1 | ||
fi |