From cd1885d29e194f17640c60919f00a7a46a8745d9 Mon Sep 17 00:00:00 2001 From: Diego Mascialino Date: Mon, 18 Feb 2019 10:51:31 -0300 Subject: [PATCH] Remove API Key Authentication code for go when cookie is used. (#1601) --- modules/openapi-generator/src/main/resources/go/api.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/go/api.mustache b/modules/openapi-generator/src/main/resources/go/api.mustache index 175962642dd..fe72ace87e7 100644 --- a/modules/openapi-generator/src/main/resources/go/api.mustache +++ b/modules/openapi-generator/src/main/resources/go/api.mustache @@ -236,6 +236,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{/hasBodyParam}} {{#authMethods}} {{#isApiKey}} +{{^isKeyInCookie}} if ctx != nil { // API Key Authentication if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { @@ -253,7 +254,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{/isKeyInQuery}} } } - +{{/isKeyInCookie}} {{/isApiKey}} {{/authMethods}} r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)