Converting JSON to canonical form for uniform validation.