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

python-paho-template doesn't work with latest RC of @asyncapi/generator #32

Closed
forsberg opened this issue Nov 2, 2020 · 5 comments · Fixed by #47
Closed

python-paho-template doesn't work with latest RC of @asyncapi/generator #32

forsberg opened this issue Nov 2, 2020 · 5 comments · Fixed by #47
Labels
bug Something isn't working released stale

Comments

@forsberg
Copy link

forsberg commented Nov 2, 2020

Describe the bug

Trying to use python-paho-template with the latest RC (v1.0.0-rc.13) fails with key.startsWith is not a function

How to Reproduce

$ cd test-ag
$ cat package.json
{
  "name": "test-ag",
  "version": "0.0.0",
  "description": "Test Asyncapi generator / Paho MQTT Template",
  "dependencies": {
    "@asyncapi/generator": "v1.0.0-rc.13",
    "npm": "^6.14.8"
  },
  "license": "ISC"
}
$ npm install
$ mkdir out
npx ag --debug https://raw.githubusercontent.com/asyncapi/python-paho-template/0f6d7ccc04139ca24cfbb76152d41f3415f60bf9/samples/temperature.yaml @asyncapi/python-paho-template -o out
Something went wrong:
TypeError: key.startsWith is not a function
    at Channel.extension (/home/forsberg/slask/test-ag/node_modules/@asyncapi/parser/lib/mixins/specification-extensions.js:56:14)
    at Channel.ext (/home/forsberg/slask/test-ag/node_modules/@asyncapi/parser/lib/mixins/specification-extensions.js:75:17)
    at getFunctionNameByChannel (/home/forsberg/slask/test-ag/node_modules/@asyncapi/generator/node_modules/@asyncapi/python-paho-template/filters/all.js:297:30)
    at Context.functionName (/home/forsberg/slask/test-ag/node_modules/@asyncapi/generator/node_modules/@asyncapi/python-paho-template/filters/all.js:19:10)
    at Template.root [as rootRenderFunc] (eval at _compile (/home/forsberg/slask/test-ag/node_modules/nunjucks/src/environment.js:631:18), <anonymous>:179:38)
    at Template.render (/home/forsberg/slask/test-ag/node_modules/nunjucks/src/environment.js:550:10)
    at Environment.renderString (/home/forsberg/slask/test-ag/node_modules/nunjucks/src/environment.js:378:17)
    at /home/forsberg/slask/test-ag/node_modules/@asyncapi/generator/lib/generator.js:639:21
    at new Promise (<anonymous>)
    at Generator.renderString (/home/forsberg/slask/test-ag/node_modules/@asyncapi/generator/lib/generator.js:638:12)

Expected behavior

I guess I'll have to suffer a bit from running the bleeding edge generator (and I will investigate if we actually need this), but the expected behaviour was that.. it would generate python code :-)

@forsberg forsberg added the bug Something isn't working label Nov 2, 2020
forsberg added a commit to forsberg/python-paho-template that referenced this issue Nov 2, 2020
@github-actions
Copy link

github-actions bot commented Jan 2, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Jan 2, 2021
@derberg
Copy link
Member

derberg commented Jan 4, 2021

@forsberg hey, I'm not an expert in this template, but looks like there is no issue either with the generator or template but rather the example.

example has this x-scs-function-name but expects this x-function-name. Try to just fix the extension name in the asyncapi file and see if it works as expected

@damaru-inc
Copy link
Contributor

I was unable to reproduce the error. The sample publishing code that gets generated doesn't provide arguments for the SensorReading constructor, but besides that it works.

@derberg
Copy link
Member

derberg commented Jan 27, 2021

not able to reproduce so closing

@derberg derberg closed this as completed Jan 27, 2021
SebastienAndreo pushed a commit to SebastienAndreo/python-paho-template that referenced this issue Feb 9, 2021
@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.2.8 🎉

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
bug Something isn't working released stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants