授权不适合swagger球衣?

时间:2018-05-23 05:43:45

标签: jersey-2.0 swagger-2.0

这是我的swagger UI的index.html文件。

$(function(){       window.swaggerUi = new SwaggerUi({       网址:“http://localhost:8080/hootout/rest/api-docs”,       dom_id:“swagger-ui-container”,       supportedSubmitMethods:['get','post','put','delete','patch'],       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)
    });

  },
  onFailure: function(data) {
    log("Unable to Load SwaggerUI");
  },
  docExpansion: "none"
});

$('#input_apiKey').change(function() {
  var key = $('#input_apiKey')[0].value;
  log("key: " + key);
  if(key && key.trim() != "") {
    log("added key " + key);
    window.authorizations.add("key", new ApiKeyAuthorization("api_key", key, "query"));
  }
})
window.swaggerUi.load();

});

我在项目中第一次实现了swagger UI。我将这个index.html文件用于swagger UI。我的招摇UI工作正常,但我没有得到API的授权。 谢谢......

0 个答案:

没有答案