grails.json.legacy.builder = false
8.1.7 More on JSONBuilder
Version: 3.2.3
8.1.7 More on JSONBuilder
The previous section on on XML and JSON responses covered simplistic examples of rendering XML and JSON responses. Whilst the XML builder used by Grails is the standard XmlSlurper found in Groovy.
For JSON, since Grails 3.1, Grails uses Groovy’s StreamingJsonBuilder by default and you can refer to the Groovy documentation and StreamingJsonBuilder API documentation on how to use it.
In older version of Grails a custom JSON builder was used called grails.web.JSONBuilder. This class is considered deprecated. However, if you are upgrading an application you can re-enable it with the following configuration in application.groovy
: