How to get Swagger to send api_key in Header and in request URL?

后端 未结 2 1329
伪装坚强ぢ
伪装坚强ぢ 2021-01-15 00:30

I am able to either get the api key to be represented as a header or as a tag on the end of the url, but I am needing it to be both. Is there anyway for this to be possible?

2条回答
  •  無奈伤痛
    2021-01-15 01:11

    window.swaggerUi.api.clientAuthorizations.add(swashbuckleConfig.apiKeyName, new SwaggerClient.ApiKeyAuthorization(swashbuckleConfig.apiKeyName, key, "header"));
          window.swaggerUi.api.clientAuthorizations.add(swashbuckleConfig.apiKeyName + " query", new SwaggerClient.ApiKeyAuthorization(swashbuckleConfig.apiKeyName, key, "query"));
    

提交回复
热议问题