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

Regression in v1.3.0 - "info.id is not a function" #357

Closed
Ernir opened this issue Aug 3, 2023 · 7 comments · Fixed by #359
Closed

Regression in v1.3.0 - "info.id is not a function" #357

Ernir opened this issue Aug 3, 2023 · 7 comments · Fixed by #359
Labels
bug Something isn't working released

Comments

@Ernir
Copy link

Ernir commented Aug 3, 2023

Describe the bug

When using the markdown template on any document, I receive the error

Generator Error: info.id is not a function

How to Reproduce

Using any document, such as the simple example:

asyncapi: '2.6.0'
info:
  title: Account Service
  version: 1.0.0
  description: This service is in charge of processing user signups
channels:
  user/signedup:
    subscribe:
      message:
        $ref: '#/components/messages/UserSignedUp'
components:
  messages:
    UserSignedUp:
      payload:
        type: object
        properties:
          displayName:
            type: string
            description: Name of the user
          email:
            type: string
            format: email
            description: Email of the user

and running the generator, I receive:

$ asyncapi generate fromTemplate simple.yaml https://github.com/asyncapi/markdown-template/ --force-write
Generation in progress. Keep calm and wait a bit... done

Generator Error: info.id is not a function

This seems to have been introduced in https://github.com/asyncapi/markdown-template/releases/tag/v1.3.0, prior versions work.

I am using the following version of the asyncapi CLI:

$ asyncapi --version
@asyncapi/cli/0.40.3 linux-x64 node-v16.15.1

Expected behavior

I would expect the markdown generator to work as it did prior to 1.3.0 🙂

$ asyncapi generate fromTemplate simple.yaml https://github.com/asyncapi/markdown-template/tree/430c90f2d847ef6d2b52c247e37e5a1712171a8f --force-write
Generation in progress. Keep calm and wait a bit... done
Check out your shiny new generated files at <my path>
@Ernir Ernir added the bug Something isn't working label Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

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.

@jonaslagoni
Copy link
Member

jonaslagoni commented Aug 3, 2023

Thanks for the issue @Ernir, gonna make sure that a proper error is given when this happens.

You need to update your CLI to at least v0.51.10 because that is where the expected generator version is updated.

I am gonna do a followup PR in a sec.

@jonaslagoni
Copy link
Member

That or hardcode the template version in your command 🙂

@Ernir
Copy link
Author

Ernir commented Aug 3, 2023

Thanks for the issue @Ernir, gonna make sure that a proper error is given when this happens.

You need to update your CLI to at least v0.51.10 because that is where the expected generator version is updated.

I am gonna do a followup PR in a sec.

Thanks, if upgrading the CLI is all that's needed, this sounds a lot less serious than I thought. Was just surprised this morning when the command I used yesterday (referencing the default branch) stopped working.

Thanks!

@derberg
Copy link
Member

derberg commented Aug 3, 2023

@jonaslagoni we should actually fix https://github.com/asyncapi/markdown-template/blob/master/package.json#L56C21-L56C21 too as generator supports new parser since v1.10.0

@Ernir please never use generator and templates on production like:

asyncapi generate fromTemplate simple.yaml https://github.com/asyncapi/markdown-template/

or

asyncapi generate fromTemplate simple.yaml @asyncapi/markdown-template

always make sure you use specific template version as otherwise you get into troubles like you just had

more info: https://www.asyncapi.com/docs/tools/generator/versioning

always do asyncapi generate fromTemplate simple.yaml @asyncapi/[email protected] and never update automatically, always review what is new

@derberg
Copy link
Member

derberg commented Aug 3, 2023

@jonaslagoni just noticed #359. Merged

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.3.2 🎉

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.

4 participants