Input validation and output formatting in DX API

With DX API v2, validation remains server‑side and rule‑driven.

Implement the AllowedStartingFields data transform on the case type class. It whitelists the scalar/page/page‑list fields that the Create Case API is allowed to take in content, pageInstructions, and attachments.

Alternatively you can also add a validate rule in the case start process for mandatory checks add meaningful messages (Message/Field Value).

On error, DX v2 returns 422 with errorDetails. You typically customize what messages get added and how they’re localized, rather than rewriting the whole JSON structure. Use Message rules, Field Values, and your Validate logic to compose business‑friendly text. Those messages end up in the DX errorDetails[].localizedValue the client receives.
PFB the links for reference-