From 8f738a9b418b4eb5f3acfae0d0efbce22d2d58b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9Fda=C5=9F?= Date: Tue, 25 Feb 2020 03:45:16 +0100 Subject: [PATCH] [erlang] Do not export function if not defined. (#5394) Logic added to logic_handler.mustache so that it does not export authorize_api_key/3 when the function is not defined, leading to compilation error. --- .../main/resources/erlang-server/logic_handler.mustache | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache b/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache index 509ed3107b7..b14464940f3 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/logic_handler.mustache @@ -1,7 +1,14 @@ -module({{packageName}}_logic_handler). -export([handle_request/4]). +{{#authMethods}} + {{#isApiKey}} -export([authorize_api_key/3]). + {{/isApiKey}} +{{/authMethods}} +{{^authMethods}} +-export([authorize_api_key/3]). +{{/authMethods}} -type context() :: #{binary() => any()}. -type handler_response() ::{ Status :: cowboy:http_status(),