title: Can't get JSON.registerObjectMarshaller() to create custom JSON in Grails 1.3.7
body: <p>I would like to include transient properties in my JSON output for one of my classes (Account). The best way for me to do this would be to use JSON.grailsObjectMarshaller() in the Bootstrap.groovy to create a custom JSON structure for my class, however I can't seem to get it to work. Here is my code for the Bootstrap.groovy:</p>
  
  <pre><code>import grails.converters.deep.JSON
  import stocks.Account
  
  class BootStrap {
  
  def init = { servletContext -&gt;
  
      JSON.registerObjectMarshaller(Account, {
          println("test")
          def returnArray = [:]
          returnArray['email'] = it.email
          returnArray['test'] = "success"
          return returnArray
      })
  
  }
  
  def destroy = {
  }
  
  }
  </code></pre>
  
  <p>Here is my code for the AccountController.groovy:</p>
  
  <pre><code>def jsonTest = {
      def account = Account.findById('1')
      render account as JSON
  }
  </code></pre>
  
  <p>And here is my output, which acts as if I hadn't called JSON.registerObjectMarshaller() at all:</p>
  
  <pre><code>{"class":"stocks.Account","id":1,"email":"ian...","firstName":"Ian"}
  </code></pre>
  
  <p>Things that I've tried, but didn't seem to help:</p>
  
  <ol>
  <li>Grails clean</li>
  <li>Increasing the priority to 1 on JSON.registerObjectMarshaller()</li>
  <li>Using the regular JSON converter instead of the deep converter</li>
  </ol>