I had some fun creating a custom json in Grails. There is grails.web.JSONBuilder and groovy.json.JsonBuilder. The former seems to be deprecated (according to the grails documentation). But as it uses the same api to create json as the render method I looked at it anyway. Both builder do create json but they are, let’s say unintuitive, when it it comes to arrays with nested objects. If you ask google a lot of people seem to fight with this as well. Often the answers are not enlightening either. This blog will show a number of simple examples that will hopefully help you understand JSONBuilder/render and JsonBuilder.