added validator for v2
This commit is contained in:
@@ -14,13 +14,15 @@ class MainView extends Backbone.View
|
||||
if (sorterName == "alpha") # sort top level paths if alpha
|
||||
@model.apisArray.sort sorter
|
||||
|
||||
log @model
|
||||
if @model.info and @model.info.license and typeof @model.info.license is 'string'
|
||||
name = @model.info.license
|
||||
url = @model.info.licenseUrl
|
||||
@model.info.license = {}
|
||||
@model.info.license.name = name
|
||||
@model.info.license.url = url
|
||||
|
||||
if @model.url.indexOf('http://localhost') is -1 and @model.swaggerVersion is 2
|
||||
@model.validatorUrl = @model.url
|
||||
|
||||
render: ->
|
||||
# Render the outer container for resources
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
<h4 style="color: #999">[ <span style="font-variant: small-caps">base url</span>: {{basePath}}
|
||||
{{#if apiVersion}}
|
||||
, <span style="font-variant: small-caps">api version</span>: {{apiVersion}}
|
||||
{{/if}}]</h4>
|
||||
{{/if}}]
|
||||
{{#if validatorUrl}}
|
||||
<span style="float:right"><a href="http://online.swagger.io/validator/debug?url={{url}}"><img id="foo" src="http://online.swagger.io/validator?url={{url}}"></a>
|
||||
</span>
|
||||
{{/if}}
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user