diff --git a/dist/swagger-ui.js b/dist/swagger-ui.js index f8af33ca..4589cc51 100644 --- a/dist/swagger-ui.js +++ b/dist/swagger-ui.js @@ -1735,7 +1735,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) {
diff --git a/src/main/coffeescript/view/OperationView.coffee b/src/main/coffeescript/view/OperationView.coffee
index 60ee4dcd..38135726 100644
--- a/src/main/coffeescript/view/OperationView.coffee
+++ b/src/main/coffeescript/view/OperationView.coffee
@@ -205,7 +205,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
@@ -231,4 +231,4 @@ class OperationView extends Backbone.View
 
   toggleOperationContent: ->
     elem = $('#' + Docs.escapeResourceName(@model.resourceName) + "_" + @model.nickname + "_" + @model.method + "_" + @model.number + "_content")
-    if elem.is(':visible') then Docs.collapseOperation(elem) else Docs.expandOperation(elem)
\ No newline at end of file
+    if elem.is(':visible') then Docs.collapseOperation(elem) else Docs.expandOperation(elem)