Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[erlang] Do not export function if not defined. #5394

Merged
merged 1 commit into from
Feb 25, 2020

Conversation

cagdass
Copy link
Contributor

@cagdass cagdass commented Feb 21, 2020

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 of *_logic_handler.erl, where * is openapi by default.

rebar3 shell under the root directory of the code stub can be run to compile.

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.
@wing328
Copy link
Member

wing328 commented Feb 25, 2020

cc @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10)

-export([authorize_api_key/3]).
{{/isApiKey}}
{{/authMethods}}
Copy link
Member

@wing328 wing328 Feb 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works if the spec contains 1 API key definitions, If it has more than 1, then it won't work. I'll submit a fix in another PR. Thanks for your contribution.

UPDATE: filed #5424

@wing328 wing328 merged commit 8f738a9 into OpenAPITools:master Feb 25, 2020
@wing328 wing328 added this to the 4.3.0 milestone Feb 25, 2020
MikailBag pushed a commit to MikailBag/openapi-generator that referenced this pull request Mar 23, 2020
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.
@wing328
Copy link
Member

wing328 commented Mar 27, 2020

@cagdass thanks for the PR, which has been included in the 4.3.0 release: https://twitter.com/oas_generator/status/1243455743937789952

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants