added authorization support from swagger-js 2.0
This commit is contained in:
@@ -43,6 +43,8 @@ class SwaggerUi extends Backbone.Router
|
||||
@mainView?.clear()
|
||||
@headerView.update(@options.url)
|
||||
@api = new SwaggerApi(@options)
|
||||
@api.build()
|
||||
@api
|
||||
|
||||
# This is bound to success handler for SwaggerApi
|
||||
# so it gets called when SwaggerApi completes loading
|
||||
@@ -51,8 +53,8 @@ class SwaggerUi extends Backbone.Router
|
||||
@mainView = new MainView({model: @api, el: $('#' + @dom_id)}).render()
|
||||
@showMessage()
|
||||
switch @options.docExpansion
|
||||
when "full" then Docs.expandOperationsForResource('')
|
||||
when "list" then Docs.collapseOperationsForResource('')
|
||||
when "full" then Docs.expandOperationsForResource('')
|
||||
when "list" then Docs.collapseOperationsForResource('')
|
||||
@options.onComplete(@api, @) if @options.onComplete
|
||||
setTimeout(
|
||||
=>
|
||||
|
||||
@@ -33,5 +33,5 @@ class HeaderView extends Backbone.View
|
||||
|
||||
update: (url, apiKey, trigger = false) ->
|
||||
$('#input_baseUrl').val url
|
||||
$('#input_apiKey').val apiKey
|
||||
@trigger 'update-swagger-ui', {url:url, apiKey:apiKey} if trigger
|
||||
#$('#input_apiKey').val apiKey
|
||||
@trigger 'update-swagger-ui', {url:url} if trigger
|
||||
|
||||
Reference in New Issue
Block a user