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

fix: Add enumerable to template parameters #322

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

Tenischev
Copy link
Member

Description
There is a bug with definition of templateParams
Use following hooks:

module.exports = register => {
    register('generate:before', generator => {
        console.log(generator.templateParams);
    });
};
module.exports = register => {
    register('generate:after', generator => {
        console.log("/////////////////////////////////");
        console.log(generator.templateParams);
    });
};

Run as

docker run --rm -it -v ../java-spring-template-my-fork:/app/my-fork -v $pwd/asyncapi.yml:/app/asyncapi.yml -v $pwd/output:/app/output asyncapi/generator -o ./output -p listenerConcurrency=5 -p listenerPollTimeout=4000 asyncapi.yml /app/my-fork --force-write

Output:

{}
//////////////////////////////////
{}

For details about fix and enumerable - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty

Related issue(s)
no, discussion in Slack

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@fmvilas fmvilas left a comment

Choose a reason for hiding this comment

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

Thanks!

@fmvilas fmvilas merged commit 48a0c2d into asyncapi:master Apr 30, 2020
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.42.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants