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

[BUG] The java-template does nog seem to work at all #237

Open
2 tasks done
hartmanjan1970 opened this issue Feb 10, 2025 · 2 comments
Open
2 tasks done

[BUG] The java-template does nog seem to work at all #237

hartmanjan1970 opened this issue Feb 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@hartmanjan1970
Copy link

Describe the bug.

I want to generate the example single-channel.yml i get the feedback the version of the asyncapi is incorrect.
The example asyncapi is v 2.2.2 and the generator and the java-template should be able to use this version.

Expected behavior

I would expect the example to be generated flawlesly

Screenshots

my yaml file used is from: https://raw.githubusercontent.com/asyncapi/java-template/master/test/mocks/single-channel.yml

asyncapi: 2.2.0
info:
  title: Record Label Service
  version: 1.0.0
  description: This service is in charge of processing music
servers:
  production:
    url: ibmmq://localhost:1414/QM1/DEV.APP.SVRCONN
    protocol: ibmmq-secure
    description: Production Instance 1
    bindings:
      ibmmq:
        cipherSpec: ANY_TLS12
channels:
  song/released:
    publish:
      message:
        $ref: '#/components/messages/song'
    subscribe:
      message:
        $ref: '#/components/messages/song'

components:
  messages:
    song:
      payload:
        type: object
        properties:
          title:
            type: string
            description: Song title
          artist:
            type: string
            description: Song artist
          album:
            type: string
            description: Song album
          genre:
            type: string
            description: Primary song genre
          length:
            type: integer
            description: Track length in seconds
jhartman micro-service]$ ag --version
2.6.0
jhartman micro-service]$ /pub/git/AsyncAPI/asyncapi/generator/apps/generator/cli.js ./src/main/contracts/single-channel.yml @asyncapi/java-template -o ./target/docs -p server=production
Warning: The "ag" CLI is deprecated and will be removed in a future release. Please use the AsyncAPI CLI instead. See release notes for details: https://github.com/asyncapi/generator/releases/tag/%40asyncapi%2Fgenerator%402.6.0. You can hide this working using --disable-warning flag.
(node:1634413) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Something went wrong:
Error: This template is not compatible with the current version of the generator (2.6.0). This template is compatible with the following version range: >=1.3.0 <2.0.0.
    at isTemplateCompatible (/pub/git/AsyncAPI/asyncapi/generator/apps/generator/lib/templateConfigValidator.js:57:11)
    at module.exports.validateTemplateConfig (/pub/git/AsyncAPI/asyncapi/generator/apps/generator/lib/templateConfigValidator.js:30:3)
    at Generator.configureTemplateWorkflow (/pub/git/AsyncAPI/asyncapi/generator/apps/generator/lib/generator.js:311:5)
    at async Generator.generate (/pub/git/AsyncAPI/asyncapi/generator/apps/generator/lib/generator.js:199:5)
    at async Generator.generateFromFile (/pub/git/AsyncAPI/asyncapi/generator/apps/generator/lib/generator.js:500:12)
    at async /pub/git/AsyncAPI/asyncapi/generator/apps/generator/cli.js:164:9
[[email protected]@v2l1-jhartman micro-service]$ 
async /home/users/jhartman/.nvm/versions/node/v22.12.0/lib/node_modules/@asyncapi/generator/cli.js:164:9

How to Reproduce

generate the example single-channel.yml as described in the readme

🥦 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

@hartmanjan1970 hartmanjan1970 added the bug Something isn't working label Feb 10, 2025
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 Feb 10, 2025

issue seems to be related to: https://github.com/asyncapi/java-template/blob/master/package.json#L102

@hartmanjan1970 you use latest generator, so @dalelane or other maintainer needs to agree to update above setting and enable support for generator v2

@dalelane fyi Generator v2 was released as we had to drop support for older Nodejs versions, and they also are not on long term support anymore either -> https://github.com/asyncapi/generator/releases/tag/v2.0.0 so you just need to update "generator": ">=1.3.0 <2.0.0", to "generator": ">=1.3.0 <3.0.0", to make sure people using latest generator can still use this java template. For you it is simple minor release as old versions of generator will still work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants