-
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.
chore: add scripts and config for openapi gen
- Loading branch information
Showing
3 changed files
with
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
declare -r TMP_FOLDER='../discue-io-api-docs-next/./tmp' | ||
declare -r INTERMEDIATE_FILE="${TMP_FOLDER}/api-endpoints-intermediate.md" | ||
declare -r ENVIRONMENT_FILE="../discue-io-api-docs-next/generate-api-doc.config.json" | ||
declare -r TEMPLATE_FOLDER="../discue-io-api-docs-next/templates" | ||
|
||
declare -r API_INPUT_FILE="../discue-io-api-docs-next/api.yaml" | ||
|
||
declare -r FINAL_TITLE="Endpoints" | ||
declare -r FINAL_FILE_PATH="../discue-io-api-docs-next/docs/endpoints/README.md" | ||
|
||
mkdir -p "${TMP_FOLDER}" | ||
|
||
cd ../widdershins && node widdershins -e "${ENVIRONMENT_FILE}" -o "${INTERMEDIATE_FILE}" -u "${TEMPLATE_FOLDER}" "${API_INPUT_FILE}" \ | ||
&& sed -i "s/title: .*/title: ${FINAL_TITLE}/" "${INTERMEDIATE_FILE}" \ | ||
&& cp ./"${INTERMEDIATE_FILE}" ${FINAL_FILE_PATH} | ||
|
||
rm -rf "${TMP_FOLDER}" |
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,35 @@ | ||
{ | ||
"headings": 3, | ||
"language_tabs": [ | ||
{ | ||
"javascript": "JavaScript" | ||
}, | ||
{ | ||
"python": "Python" | ||
}, | ||
{ | ||
"go": "Go" | ||
} | ||
], | ||
"verbose": false, | ||
"tagGroups": [ | ||
{ | ||
"title": "Messages", | ||
"tags": [ | ||
"queue messages" | ||
] | ||
}, | ||
{ | ||
"title": "Listeners", | ||
"tags": [ | ||
"queue listeners" | ||
] | ||
}, | ||
{ | ||
"title": "Queues", | ||
"tags": [ | ||
"queues" | ||
] | ||
} | ||
] | ||
} |
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,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
declare -r TMP_FOLDER='../discue-io-docs-next/./tmp' | ||
declare -r INTERMEDIATE_FILE="${TMP_FOLDER}/api-endpoints-intermediate.md" | ||
declare -r ENVIRONMENT_FILE="../discue-io-docs-next/generate-api-doc.config.json" | ||
declare -r TEMPLATE_FOLDER="../discue-io-docs-next/templates" | ||
|
||
declare -r API_INPUT_FILE="../discue-io-docs-next/api.yaml" | ||
|
||
declare -r FINAL_TITLE="Endpoints" | ||
declare -r FINAL_FILE_PATH="../discue-io-api-docs-next/docs/endpoints/README.md" | ||
|
||
mkdir -p "${TMP_FOLDER}" | ||
|
||
npx widdershins -e "${ENVIRONMENT_FILE}" -o "${INTERMEDIATE_FILE}" -u ."${TEMPLATE_FOLDER}" "${API_INPUT_FILE}" \ | ||
&& sed -i "s/title: .*/title: ${FINAL_TITLE}/" "${INTERMEDIATE_FILE}" \ | ||
&& cp ./"${INTERMEDIATE_FILE}" ${FINAL_FILE_PATH} | ||
|
||
rm -rf "${TMP_FOLDER}" |