-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow (visually) exporting the list of known API error codes (#28)
* Allow (visually) exporting the list of known API error codes The goal, as stated in the change, is to easy copy-pasting to developer.kivra.com, thus reducing the chance of inconsistency * Move implementation to Bash script
- Loading branch information
1 parent
29dbfe4
commit 8e879fb
Showing
2 changed files
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
if ! command -v jq &>/dev/null; then | ||
echo "You need 'jq' to run this script." | ||
exit 1 | ||
fi | ||
|
||
echo "Copy-paste to developer.kivra.com's swagger.yml" | ||
echo "<copy-paste>" | ||
echo " | Code | Short Message | Long Message |" | ||
echo " | ---- | ------------- | ------------ |" | ||
jq -r 'to_entries | sort_by(.key) | .[] | " | \(.key) | \(.value.short_message) | \(.value.long_message) |"' <api-errors.json | ||
echo "</copy-paste>" |