diff --git a/README.md b/README.md index ce1ceae..5170746 100644 --- a/README.md +++ b/README.md @@ -127,3 +127,17 @@ The following message contains the same information, but is more concise: Run the linter to validate the error definitions in [`api-errors.json`](./api-errors.json): make lint + +## Export for use in `developer.kivra.com` + +A `util` script is made available to allow copy-pasting the entire list for +acceptance in . + +For this you need to have [`jq`](https://github.com/jqlang/jq#installation) installed. + +```console +./util/to-developer.kivra.com.sh +``` + +Whatever is between `` and `` is deemed usable +(YML-formatted) in . diff --git a/util/to-developer.kivra.com.sh b/util/to-developer.kivra.com.sh new file mode 100755 index 0000000..22bb45d --- /dev/null +++ b/util/to-developer.kivra.com.sh @@ -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 "" +echo " | Code | Short Message | Long Message |" +echo " | ---- | ------------- | ------------ |" +jq -r 'to_entries | sort_by(.key) | .[] | " | \(.key) | \(.value.short_message) | \(.value.long_message) |"' "