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

Java-spring templates have undefined members #42

Closed
RobertDiebels opened this issue Feb 21, 2019 · 7 comments
Closed

Java-spring templates have undefined members #42

RobertDiebels opened this issue Feb 21, 2019 · 7 comments

Comments

@RobertDiebels
Copy link

RobertDiebels commented Feb 21, 2019

Both the MqttConfig and AmqpConfig partial template files will currently result in a compiler error when a spec contains a topic object with a publish property.

In the MqttConfig template the setDefaultTopic function will be called with an undefined variable. Since the template only creates the corresponding private members if the topic is of type subscribe.

The same applies to the AmqpConfig template file where the setExchangeName function will be called with an undefined variable. Since the template only creates the corresponding private members if the topic is of type subscribe.

@rmelian
Copy link
Contributor

rmelian commented Feb 21, 2019

Hi @RobertDiebels thank you for reporting this, I'll take a look ASAP

@RobertDiebels
Copy link
Author

RobertDiebels commented Feb 21, 2019

@rmelian Happy to help. I can confirm that the expected output is generated if the handle-bars if-statement for the private members in MqttConfig is removed. As for the AqmpConfig partial, changing the if-statment condition to check for publish rather than subscribe for the Exchange private members should fix the issue.

I altered the partials in my local installation of the generator to verify.

@rmelian
Copy link
Contributor

rmelian commented Feb 21, 2019

do you want to submit a PR?

@RobertDiebels
Copy link
Author

@rmelian I'll submit a PR in an hour or 2-3 if that's ok.

@RobertDiebels
Copy link
Author

Done.

@rmelian
Copy link
Contributor

rmelian commented Feb 21, 2019

hi @RobertDiebels can you share the asyncapi definition you are using

rmelian added a commit that referenced this issue Feb 21, 2019
fix(undefined-vars): [ISSUE-42] - Resolves issue #42.
@rmelian
Copy link
Contributor

rmelian commented Feb 21, 2019

I just approved your PR @RobertDiebels great work

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

No branches or pull requests

2 participants