docs: document API number validation

This commit is contained in:
nyan404 committed 2026-08-25 04:20:01 +03:00
1 parent a66d659400
commit e4fa5c7ab9
1 file changed
+1
+1
View File
@@ -221,6 +221,7 @@ def calculate_payload(payload: dict[str, Any]) -> dict[str, Any]:
return {"mode": mode, "result": asdict(result), "message": render_inspection(report, result)}
if mode == "goal":
def _number_value(key: str) -> float:
"""Читает числовое поле запроса и отклоняет NaN/значения ниже нуля."""
value = _required(payload, key)
if isinstance(value, bool):
raise ApiError(f"Поле {key} должно быть числом")