AOSSIE-Org / AOSSIE-Org/EduAid
[BUG]: API endpoint mismatch between /get_shortq_answer and /get_answer breaks tests
- Lenguaje dominante
- JavaScript
- Estrellas
- 171
- Forks
- 425
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### 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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.