Hi,
I downloaded swagger (1.1.7) from GitHub
And I have added below mentioned changes in Index.html to pass headers parameters in the Request.
supportHeaderParams:true,
headers: { "Authorization": "XXXX", "someOtherHeader": "YYYY" },
$(function () {
window.swaggerUi = new SwaggerUi({
discoveryUrl:"http://petstore.swagger.wordnik.com/api/api-docs.json",
apiKey:"Authorization",
dom_id:"swagger-ui-container",
supportHeaderParams:true,
apiKeyName: "Authorization",
headers: { "Authorization": "XXXX", "someOtherHeader": "YYYY" },
supportedSubmitMethods: ['get', 'post', 'put'],
onComplete: function(swaggerApi, swaggerUi){
if(console) {
console.log("Loaded SwaggerUI")
console.log(swaggerApi);
console.log(swaggerUi);
}
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
},
onFailure: function(data) {
if(console) {
console.log("Unable to Load SwaggerUI");
console.log(data);
}
},
docExpansion: "none"
});
window.swaggerUi.load();
});
But header parameters are not sent with the request the below mentioned is my request and response headers.
Request Headers
Accept application/json, text/javascript, /; q=0.01
Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection keep-alive
Host localhost:8080
Origin null
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101
Firefox/7.0.1
Response Headers
Access-Control-Allow-Head... Content-Type,Authorization
Access-Control-Allow-Meth... GET, POST, DELETE, PUT
Access-Control-Allow-Orig... *
Access-Control-Request-He... Authorization
Content-Length 187
Content-Type application/json
Date Fri, 19 Apr 2013 05:42:35 GMT
Server Apache-Coyote/1.1
Please help me in resolving the issue?