From 5f4eec1b8a7c49efc0e023976a298c7960b14d31 Mon Sep 17 00:00:00 2001 From: tomrac87 Date: Wed, 28 Aug 2013 15:39:50 +0200 Subject: [PATCH 1/2] Added proper formatting for hal+json Content-Type responses --- dist/swagger-ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index bc16d52f..da762750 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -1673,7 +1673,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; if (content === void 0) { code = $('').text("no content"); pre = $('
').append(code);
-      } else if (contentType.indexOf("application/json") === 0) {
+      } else if (contentType.indexOf("application/json") === 0 || contentType.indexOf("application/hal+json") === 0) {
         code = $('').text(JSON.stringify(JSON.parse(content), null, 2));
         pre = $('
').append(code);
       } else if (contentType.indexOf("application/xml") === 0) {

From ff05f9113b46244eec98c66d2a9b98cd46e523e0 Mon Sep 17 00:00:00 2001
From: tomrac87 
Date: Mon, 2 Sep 2013 10:02:26 +0200
Subject: [PATCH 2/2] Added proper formatting for hal+json Content-Type
 responses in coffeescript source file

---
 src/main/coffeescript/view/OperationView.coffee | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/coffeescript/view/OperationView.coffee b/src/main/coffeescript/view/OperationView.coffee
index 41792f9b..d4281b7a 100644
--- a/src/main/coffeescript/view/OperationView.coffee
+++ b/src/main/coffeescript/view/OperationView.coffee
@@ -192,7 +192,7 @@ class OperationView extends Backbone.View
     if content == undefined
       code = $('').text("no content")
       pre = $('
').append(code)
-    else if contentType.indexOf("application/json") == 0
+    else if contentType.indexOf("application/json") == 0 || contentType.indexOf("application/hal+json") == 0
       code = $('').text(JSON.stringify(JSON.parse(content), null, 2))
       pre = $('
').append(code)
     else if contentType.indexOf("application/xml") == 0