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

This template is not compatible with the current version of the generator #408

Closed
2 tasks done
armensanoyan opened this issue Nov 13, 2024 · 4 comments · Fixed by #410
Closed
2 tasks done

This template is not compatible with the current version of the generator #408

armensanoyan opened this issue Nov 13, 2024 · 4 comments · Fixed by #410
Labels
bug Something isn't working released

Comments

@armensanoyan
Copy link

armensanoyan commented Nov 13, 2024

Describe the bug.

when running generation get this error

Error: This template is not compatible with the current version of the generator (2.5.0). This template is compatible with the following version range: >=0.50.0 <2.0.0.
at isTemplateCompatible (/opt/homebrew/lib/node_modules/@asyncapi/generator/lib/templateConfigValidator.js:57:11)
at module.exports.validateTemplateConfig (/opt/homebrew/lib/node_modules/@asyncapi/generator/lib/templateConfigValidator.js:30:3)
at Generator.configureTemplateWorkflow (/opt/homebrew/lib/node_modules/@asyncapi/generator/lib/generator.js:311:5)
at async Generator.generate (/opt/homebrew/lib/node_modules/@asyncapi/generator/lib/generator.js:199:5)
at async Generator.generateFromURL (/opt/homebrew/lib/node_modules/@asyncapi/generator/lib/generator.js:473:12)

And here is the exact command I run

ag https://raw.githubusercontent.com/asyncapi/generator/v1.4.0/test/docs/ws.yml @asyncapi/nodejs-ws-template -o output -p server=localhost

In case of downgrading to 1.10.0 it runned the generation, but I suppose it should work on version 2.5.0 too. I tried to run the same command for 2.5.0 version too like so

ag https://raw.githubusercontent.com/asyncapi/generator/v2.5.0/test/docs/ws.yml @asyncapi/nodejs-template -o output -p server=localhost

it didn't work again. But this time got an other error

Something went wrong:
Error: Input is not a corrent AsyncAPI document so it cannot be processed.
    at Generator.generateFromString (/opt/homebrew/lib/node_modules/@asyncapi/generator/lib/generator.js:264:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /opt/homebrew/lib/node_modules/@asyncapi/generator/cli.js:159:9
Errors:
[
  {
    "code": "asyncapi-is-asyncapi",
    "message": "This is not an AsyncAPI document. The \"asyncapi\" field as string is missing.",
    "path": [],
    "severity": 0,
    "source": "https://raw.githubusercontent.com/asyncapi/generator/v2.5.0/test/docs/ws.yml",
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 0,
        "character": 14
      }
    }
  },
  {
    "code": "parser",
    "message": "Mapping key must be a string scalar rather than number",
    "severity": 0,
    "path": [
      "404"
    ],
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 0,
        "character": 3
      }
    },
    "source": "https://raw.githubusercontent.com/asyncapi/generator/v2.5.0/test/docs/ws.yml"
  }
]

Expected behavior

Please provide working cli command to run generation.

Screenshots

Screenshot 2024-11-13 at 12 08 00

How to Reproduce

  1. npm install -g @asyncapi/generator
  2. ag https://raw.githubusercontent.com/asyncapi/generator/v1.4.0/test/docs/ws.yml @asyncapi/nodejs-ws-template -o output -p server=localhost

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

@armensanoyan armensanoyan added the bug Something isn't working label Nov 13, 2024
Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@derberg
Copy link
Member

derberg commented Nov 13, 2024

Hi, it might work with newer generator but that has to be checked. Please open a PR and change https://github.com/asyncapi/nodejs-ws-template/blob/master/package.json#L89 value from 2.0.0 to 3.0.0

keep in mind node 18 minimum is required

@armensanoyan
Copy link
Author

armensanoyan commented Nov 13, 2024

Hey thanks for replay. Seems like it didn't work?

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.10.0 🎉

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants