Fundamental_Analysis/scripts/update_api_spec.sh
Lv, Qi a59b994a92 WIP: Commit all pending changes across services, frontend, and docs
- Sync updates for provider services (AlphaVantage, Finnhub, YFinance, Tushare)
- Update Frontend components and pages for recent config changes
- Update API Gateway and Registry
- Include design docs and tasks status
2025-11-27 02:45:56 +08:00

25 lines
704 B
Bash
Executable File

#!/bin/bash
set -e
# Get the root directory of the project
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
echo "[API Update] Generating OpenAPI JSON from Rust Code..."
# Run the specific test in api-gateway that dumps the JSON
cargo test --manifest-path services/api-gateway/Cargo.toml --bin api-gateway openapi::tests::generate_openapi_json
if [ -f "openapi.json" ]; then
echo "[API Update] openapi.json generated successfully."
else
echo "[API Update] Error: openapi.json was not generated!"
exit 1
fi
echo "[API Update] Regenerating Frontend Types..."
cd frontend
npm run gen:api
echo "[API Update] ✅ API Spec and Frontend Client updated successfully!"