Added a helper method to enable deep encoding of nested parameters when encoding requests into JSON.