unified client
This commit is contained in:
2417
dist/lib/swagger-client.js
vendored
2417
dist/lib/swagger-client.js
vendored
File diff suppressed because it is too large
Load Diff
928
dist/swagger-ui.js
vendored
928
dist/swagger-ui.js
vendored
File diff suppressed because it is too large
Load Diff
4
dist/swagger-ui.min.js
vendored
4
dist/swagger-ui.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -26,11 +26,6 @@ class SwaggerUi extends Backbone.Router
|
|||||||
@render()
|
@render()
|
||||||
@options.progress = (d) => @showMessage(d)
|
@options.progress = (d) => @showMessage(d)
|
||||||
@options.failure = (d) =>
|
@options.failure = (d) =>
|
||||||
if @api and @api.isValid is false
|
|
||||||
log "not a valid 2.0 spec, loading legacy client"
|
|
||||||
@api = new SwaggerApi(@options)
|
|
||||||
@api.build()
|
|
||||||
else
|
|
||||||
@onLoadFailure(d)
|
@onLoadFailure(d)
|
||||||
|
|
||||||
# Create view to handle the header inputs
|
# Create view to handle the header inputs
|
||||||
|
|||||||
@@ -93,12 +93,26 @@ class OperationView extends Backbone.View
|
|||||||
|
|
||||||
$(@el).html(Handlebars.templates.operation(@model))
|
$(@el).html(Handlebars.templates.operation(@model))
|
||||||
|
|
||||||
if @model.responseClassSignature and @model.responseClassSignature != 'string'
|
# 2.0
|
||||||
|
signatureModel = null
|
||||||
|
if @model.successResponse
|
||||||
|
successResponse = @model.successResponse
|
||||||
|
for key of successResponse
|
||||||
|
value = successResponse[key]
|
||||||
|
if typeof value is 'object' and typeof value.createJSONSample is 'function'
|
||||||
|
foo = 'bar'
|
||||||
|
signatureModel =
|
||||||
|
sampleJSON: JSON.stringify(value.createJSONSample(), undefined, 2)
|
||||||
|
isParam: false
|
||||||
|
signature: value.getMockSignature()
|
||||||
|
# 1.2
|
||||||
|
else if @model.responseClassSignature and @model.responseClassSignature != 'string'
|
||||||
signatureModel =
|
signatureModel =
|
||||||
sampleJSON: @model.responseSampleJSON
|
sampleJSON: @model.responseSampleJSON
|
||||||
isParam: false
|
isParam: false
|
||||||
signature: @model.responseClassSignature
|
signature: @model.responseClassSignature
|
||||||
|
|
||||||
|
if signatureModel
|
||||||
responseSignatureView = new SignatureView({model: signatureModel, tagName: 'div'})
|
responseSignatureView = new SignatureView({model: signatureModel, tagName: 'div'})
|
||||||
$('.model-signature', $(@el)).append responseSignatureView.render().el
|
$('.model-signature', $(@el)).append responseSignatureView.render().el
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user