AOSSIE-Org / AOSSIE-Org/EduAid
Backend: Standardize defensive input validation across question-generation endpoints
- 主要言語
- JavaScript
- スター
- 171
- フォーク
- 425
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Several backend question-generation endpoints currently accept invalid or empty payloads
(e.g., missing or empty input_text, missing JSON body, invalid list fields).
This can lead to:
- Undefined behavior in NLP pipelines
- Silent failures or 500 errors
- Inconsistent API behavior compared to /get_mcq_answer
The /get_mcq_answer endpoint already implements clear defensive validation
(returning HTTP 400 with meaningful JSON errors).
Proposal:
- Reuse the same validation pattern across generation endpoints:
- /get_mcq
- /get_boolq
- /get_shortq
- /get_problems
- related *_hard endpoints where applicable
- Do NOT change successful behavior
- Return HTTP 400 with clear JSON error messages for invalid input
- Keep changes minimal and readable
I plan to open a PR after confirmation.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。