Skip to content

Commit 0da7f8b

Browse files
committed
added array check for #899
1 parent f2f939e commit 0da7f8b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/main/coffeescript/SwaggerUi.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class SwaggerUi extends Backbone.Router
1616
@dom_id = options.dom_id
1717
delete options.dom_id
1818

19+
if not options.supportedSubmitMethods?
20+
options.supportedSubmitMethods = ['get','put','post','delete','head','options','patch']
21+
1922
# Create an empty div which contains the dom_id
2023
$('body').append('<div id="' + @dom_id + '"></div>') if not $('#' + @dom_id)?
2124

src/main/coffeescript/view/OperationView.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class OperationView extends Backbone.View
4444
$(e.currentTarget.parentNode).find('#api_information_panel').hide()
4545

4646
render: ->
47-
isMethodSubmissionSupported = true #jQuery.inArray(@model.method, @model.supportedSubmitMethods) >= 0
47+
isMethodSubmissionSupported = jQuery.inArray(@model.method, @model.supportedSubmitMethods()) >= 0
4848
@model.isReadOnly = true unless isMethodSubmissionSupported
4949

5050
# 1.2 syntax for description was `notes`

0 commit comments

Comments
 (0)