chore: add print_openapi_schema and start-mock-server.sh script

This commit is contained in:
Jack Michaud
2022-12-31 16:42:12 -05:00
committed by Andreas Köpf
parent aa2d426bbc
commit b5ebab8839
2 changed files with 32 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
# switch to backend directory
pushd "$parent_path/../../backend"
export DEBUG_SKIP_API_KEY_CHECK=True
python -m print_openapi_schema > oasst-openapi.json
MOCK_SERVER_PORT=8080
docker run -d -it --rm \
-p $MOCK_SERVER_PORT:8080 \
--name wiremock \
wiremock/wiremock:2.35.0
sleep 1
curl -X POST -d @oasst-openapi.json http://localhost:$MOCK_SERVER_PORT/__admin/mappings/import
popd