Page MenuHomePhabricator

Look into ways to avoid HttpException for top-level validation
Open, Needs TriagePublic

Description

We implemented our own validation for top-level fields in JSON bodies for T363084 in order to work around the limitations of MW core's validation mechanism (T364440) and to have more consistent error messages.

We implemented this by overriding each route handler's parseBodyData in order to ensure that our validation happens before core's own validation. Relying on HttpException means that our error responses contain superfluous httpCode and httpReason keys, which is not ideal.