Avoid using JSON library in code, Spring view resolver we decide for you how to render object. Just return a "PatientMutationData" object and return it in your controller