Adding test cases around json encoder