Skip to content

Commit

Permalink
fixed a bug in the swagger ui integration
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWittmann committed Sep 22, 2015
1 parent 37e8347 commit 4ffda02
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -108,7 +108,6 @@ module Apiman {
var url = ServiceDefinitionSvcs.getServiceDefinitionUrl($scope.params.org, $scope.params.service, $scope.params.version);
Logger.debug("!!!!! Using definition URL: {0}", url);

// TODO this code was copied from apimanPlugin.ts - it needs to be shared
var authHeader = Configuration.getAuthorizationHeader();

$scope.definitionStatus = 'loading';
Expand All @@ -117,6 +116,9 @@ module Apiman {
dom_id:"swagger-ui-container",
validatorUrl:null,
sorter : "alpha",
authorizations: {
apimanauth: new SwaggerClient.ApiKeyAuthorization("Authorization", authHeader, "header")
},
onComplete: function() {
$('#swagger-ui-container a').each(function(idx, elem) {
var href = $(elem).attr('href');
Expand Down Expand Up @@ -145,7 +147,6 @@ module Apiman {
});
}
};
$window.authorizations.add("apimanauth", new ApiKeyAuthorization("Authorization", authHeader, "header"));
$window.swaggerUi = new SwaggerUi(swaggerOptions);
$window.swaggerUi.load();
$scope.hasDefinition = true;
Expand Down

0 comments on commit 4ffda02

Please sign in to comment.