diff --git a/Swashbuckle.Core/SwaggerUi/CustomAssets/index.html b/Swashbuckle.Core/SwaggerUi/CustomAssets/index.html index 7ee11a2..27ddad6 100644 --- a/Swashbuckle.Core/SwaggerUi/CustomAssets/index.html +++ b/Swashbuckle.Core/SwaggerUi/CustomAssets/index.html @@ -139,7 +139,16 @@ if (window.swashbuckleConfig.validatorUrl !== '') window.swaggerUi.options.validatorUrl = window.swashbuckleConfig.validatorUrl; - function addApiKeyAuthorization() { + window.swaggerUi.changApiKey = function (value) { + var key = value; + if(key && key.trim() != ""){ + var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization(swashbuckleConfig.apiKeyName, key, swashbuckleConfig.apiKeyIn); + window.swaggerUi.api.clientAuthorizations.add("api_key",apiKeyAuth); + log("added key "+key); + } + } + + function addApiKeyAuthorization() { var key=$("#input_apiKey")[0].value; if (key && key.trim() != "") { if (swashbuckleConfig.apiKeyIn === "query") { diff --git a/SwashbuckleEx.WebApiTest/Web.config b/SwashbuckleEx.WebApiTest/Web.config index 5b220a9..ca1190b 100644 --- a/SwashbuckleEx.WebApiTest/Web.config +++ b/SwashbuckleEx.WebApiTest/Web.config @@ -45,7 +45,7 @@ - + diff --git a/SwashbuckleEx.WebApiTest/packages.config b/SwashbuckleEx.WebApiTest/packages.config index 385ce88..85d412e 100644 --- a/SwashbuckleEx.WebApiTest/packages.config +++ b/SwashbuckleEx.WebApiTest/packages.config @@ -10,8 +10,8 @@ - - + +