AOSSIE-Org / AOSSIE-Org/EduAid

Backend: Standardize defensive input validation across question-generation endpoints

オープン
#363 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

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

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