title: Grails render map as JSON problems
body: <p>I have some code that needs to convert a map in grails to JSON. I used grails converter to convert map to JSON object as follows:</p>
  
  <pre><code>def map=[:].withDefault { [] }
  ...
  def users=service?.staff.each{map&lt;&lt;[(it.id):it.firstName+" "+it.lastName]}
  render map as JSON
  </code></pre>
  
  <p>If the map is empty I got this [:] after conversion which If I tried to parse using $.parseJSON I got the following error   </p>
  
  <pre><code>JSON.parse: unexpected character 
  </code></pre>
  
  <p>While If the map is not empty I got "[2:'Feras Odeh']" as json object which If I tried to parse I got </p>
  
  <pre><code>JSON.parse: expected ',' or ']' after array element 
  </code></pre>
  
  <p>How can I fix this?</p>