AOSSIE-Org / AOSSIE-Org/EduAid

[BUG]: API endpoint mismatch between /get_shortq_answer and /get_answer breaks tests

オープン
#519 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
JavaScript
スター
171
フォーク
425
PR マージ指標
30日以内にマージされた PR はありません

説明

### Bug Description

Description:
There is a mismatch between backend routes and test usage.

In server.py:
POST /get_shortq_answer

In test_server.py:
POST /get_answer

This results in 404 errors and JSONDecodeError when running backend tests or calling the API.

Steps to Reproduce:
1. Run the Flask backend
2. Run test_server.py
3. Observe failure when calling /get_answer

Expected Behavior:
Backend endpoint names should be consistent with tests and frontend usage.

Proposed Fix:
- Rename /get_shortq_answer to /get_answer OR
- Update tests (and frontend) to use /get_shortq_answer consistently

Additional Notes:
This inconsistency may also contribute to frontend crashes and unclear API contracts.

### Steps to Reproduce

_No response_

### Logs and Screenshots

_No response_

### Environment Details

Environment Details:
- OS: Windows 11
- Python version: 3.10.x (or run `python --version` and paste exact)
- Flask version: 2.x
- Node.js: N/A (backend only)
- Browser (if applicable): Chrome (latest)
- Repo branch: main
- Setup: Local development (Flask server running on localhost:5000)

Additional Context:
- Issue observed while running `test_Server.py`
- Backend route defined as `/get_shortq_answer`, but tests call `/get_answer`
- Results in 404 response and JSONDecodeError during test execution

### Impact

Critical - Application is unusable

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。