@@ -22,7 +22,7 @@ | |||||
<!-- enabling this will enable oauth2 implicit scope support --> | <!-- enabling this will enable oauth2 implicit scope support --> | ||||
<script src='lib/swagger-oauth.js' type='text/javascript'></script> | <script src='lib/swagger-oauth.js' type='text/javascript'></script> | ||||
<script src='spec.js' type='text/javascript'></script> | |||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
$(function () { | $(function () { | ||||
var url = window.location.search.match(/url=([^&]+)/); | var url = window.location.search.match(/url=([^&]+)/); | ||||
@@ -32,53 +32,52 @@ | |||||
url = "http://petstore.swagger.wordnik.com/v2/swagger.json"; | url = "http://petstore.swagger.wordnik.com/v2/swagger.json"; | ||||
} | } | ||||
window.swaggerUi = new SwaggerUi({ | window.swaggerUi = new SwaggerUi({ | ||||
url: url, | |||||
dom_id: "swagger-ui-container", | |||||
supportedSubmitMethods: ['get', 'post', 'put', 'delete'], | |||||
onComplete: function(swaggerApi, swaggerUi){ | |||||
log("Loaded SwaggerUI"); | |||||
if(typeof initOAuth == "function") { | |||||
/* | |||||
initOAuth({ | |||||
clientId: "your-client-id", | |||||
realm: "your-realms", | |||||
appName: "your-app-name" | |||||
url: url, | |||||
dom_id: "swagger-ui-container", | |||||
supportedSubmitMethods: ['get', 'post', 'put', 'delete'], | |||||
onComplete: function(swaggerApi, swaggerUi){ | |||||
log("Loaded SwaggerUI"); | |||||
if(typeof initOAuth == "function") { | |||||
/* | |||||
initOAuth({ | |||||
clientId: "your-client-id", | |||||
realm: "your-realms", | |||||
appName: "your-app-name" | |||||
}); | |||||
*/ | |||||
} | |||||
$('pre code').each(function(i, e) { | |||||
hljs.highlightBlock(e) | |||||
}); | }); | ||||
*/ | |||||
} | |||||
$('pre code').each(function(i, e) { | |||||
hljs.highlightBlock(e) | |||||
}); | |||||
}, | |||||
onFailure: function(data) { | |||||
log("Unable to Load SwaggerUI"); | |||||
}, | |||||
docExpansion: "none", | |||||
sorter : "alpha" | |||||
}); | |||||
}, | |||||
onFailure: function(data) { | |||||
log("Unable to Load SwaggerUI"); | |||||
}, | |||||
docExpansion: "none", | |||||
sorter : "alpha" | |||||
}); | |||||
function addApiKeyAuthorization() { | |||||
function addApiKeyAuthorization() { | |||||
var key = $('#input_apiKey')[0].value; | var key = $('#input_apiKey')[0].value; | ||||
log("key: " + key); | log("key: " + key); | ||||
if(key && key.trim() != "") { | if(key && key.trim() != "") { | ||||
log("added key " + key); | log("added key " + key); | ||||
window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query")); | window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query")); | ||||
} | } | ||||
} | |||||
} | |||||
$('#input_apiKey').change(function() { | |||||
$('#input_apiKey').change(function() { | |||||
addApiKeyAuthorization(); | addApiKeyAuthorization(); | ||||
}); | |||||
}); | |||||
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes... | |||||
/* | |||||
var apiKey = "myApiKeyXXXX123456789"; | |||||
$('#input_apiKey').val(apiKey); | |||||
addApiKeyAuthorization(); | |||||
*/ | |||||
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes... | |||||
/* | |||||
var apiKey = "myApiKeyXXXX123456789"; | |||||
$('#input_apiKey').val(apiKey); | |||||
addApiKeyAuthorization(); | |||||
*/ | |||||
window.swaggerUi.load(); | |||||
window.swaggerUi.load(); | |||||
}); | }); | ||||
</script> | </script> | ||||
</head> | </head> | ||||
@@ -22,7 +22,6 @@ | |||||
<!-- enabling this will enable oauth2 implicit scope support --> | <!-- enabling this will enable oauth2 implicit scope support --> | ||||
<script src='lib/swagger-oauth.js' type='text/javascript'></script> | <script src='lib/swagger-oauth.js' type='text/javascript'></script> | ||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
$(function () { | $(function () { | ||||
var url = window.location.search.match(/url=([^&]+)/); | var url = window.location.search.match(/url=([^&]+)/); | ||||
@@ -32,53 +31,52 @@ | |||||
url = "http://petstore.swagger.wordnik.com/v2/swagger.json"; | url = "http://petstore.swagger.wordnik.com/v2/swagger.json"; | ||||
} | } | ||||
window.swaggerUi = new SwaggerUi({ | window.swaggerUi = new SwaggerUi({ | ||||
url: url, | |||||
dom_id: "swagger-ui-container", | |||||
supportedSubmitMethods: ['get', 'post', 'put', 'delete'], | |||||
onComplete: function(swaggerApi, swaggerUi){ | |||||
log("Loaded SwaggerUI"); | |||||
if(typeof initOAuth == "function") { | |||||
/* | |||||
initOAuth({ | |||||
clientId: "your-client-id", | |||||
realm: "your-realms", | |||||
appName: "your-app-name" | |||||
url: url, | |||||
dom_id: "swagger-ui-container", | |||||
supportedSubmitMethods: ['get', 'post', 'put', 'delete'], | |||||
onComplete: function(swaggerApi, swaggerUi){ | |||||
log("Loaded SwaggerUI"); | |||||
if(typeof initOAuth == "function") { | |||||
/* | |||||
initOAuth({ | |||||
clientId: "your-client-id", | |||||
realm: "your-realms", | |||||
appName: "your-app-name" | |||||
}); | |||||
*/ | |||||
} | |||||
$('pre code').each(function(i, e) { | |||||
hljs.highlightBlock(e) | |||||
}); | }); | ||||
*/ | |||||
} | |||||
$('pre code').each(function(i, e) { | |||||
hljs.highlightBlock(e) | |||||
}); | |||||
}, | |||||
onFailure: function(data) { | |||||
log("Unable to Load SwaggerUI"); | |||||
}, | |||||
docExpansion: "none", | |||||
sorter : "alpha" | |||||
}); | |||||
}, | |||||
onFailure: function(data) { | |||||
log("Unable to Load SwaggerUI"); | |||||
}, | |||||
docExpansion: "none", | |||||
sorter : "alpha" | |||||
}); | |||||
function addApiKeyAuthorization() { | |||||
function addApiKeyAuthorization() { | |||||
var key = $('#input_apiKey')[0].value; | var key = $('#input_apiKey')[0].value; | ||||
log("key: " + key); | log("key: " + key); | ||||
if(key && key.trim() != "") { | if(key && key.trim() != "") { | ||||
log("added key " + key); | log("added key " + key); | ||||
window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query")); | window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query")); | ||||
} | } | ||||
} | |||||
} | |||||
$('#input_apiKey').change(function() { | |||||
$('#input_apiKey').change(function() { | |||||
addApiKeyAuthorization(); | addApiKeyAuthorization(); | ||||
}); | |||||
}); | |||||
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes... | |||||
/* | |||||
var apiKey = "myApiKeyXXXX123456789"; | |||||
$('#input_apiKey').val(apiKey); | |||||
addApiKeyAuthorization(); | |||||
*/ | |||||
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes... | |||||
/* | |||||
var apiKey = "myApiKeyXXXX123456789"; | |||||
$('#input_apiKey').val(apiKey); | |||||
addApiKeyAuthorization(); | |||||
*/ | |||||
window.swaggerUi.load(); | |||||
window.swaggerUi.load(); | |||||
}); | }); | ||||
</script> | </script> | ||||
</head> | </head> | ||||