title: Spring Boot 1.3 WebSocket JSON converter Produces Invalid JSON
body: <p>After upgrading to Spring Boot 1.3 (via Grails 3.1), the JSON output is rendered incorrectly. I believe it is because of the <a href="https://github.com/spring-projects/spring-boot/commit/204cb6f195ce5d6779ab63887252f2d1a69aa6f9" rel="nofollow">new auto-configured WebSocket JSON converter</a>.</p>
  
  <p>For example, with previous versions of Spring Boot (via Grails 3.0), using the following code:</p>
  
  <pre><code>@MessageMapping("/chat")
  @SendTo("/sub/chat")
  protected String chatMessage() {
      def builder = new groovy.json.JsonBuilder()
      builder {
          type("message")
          text("foobar")
      }
      builder.toString()
  }
  </code></pre>
  
  <p>This would produce:</p>
  
  <pre><code>{"type": "message", "text": "foobar"}
  </code></pre>
  
  <p>With Spring Boot 1.3 (via Grails 3.1), that web socket produces the following:</p>
  
  <pre><code>"{\"type\":\"message\",\"text\":\"foobar\"}"
  </code></pre>
  
  <p>This is not valid JSON.  How can I get rid of this new behavior and have it render the JSON as it was before? Please let me know if you have any suggestions.</p>
  
  <p>I tried overriding the new <code>configureMessageConverters</code> method, but it did not have any effect.</p>