Skip to content

Conversation

@MaksimKiselev
Copy link

@MaksimKiselev MaksimKiselev commented Mar 16, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

This PR address this issue, that was initially evaluated as feature. #465

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: 465

What is the new behavior?

AsyncApiPub and AsyncApiSub decorators now creates method decorator with different meta keys

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@flamewow
Copy link
Owner

@MaksimKiselev thanks for handling that thing
https://www.npmjs.com/package/nestjs-asyncapi/v/1.1.1

@Pedr0Rocha
Copy link
Contributor

Any idea why my subs are returning an object instead of an array here after this change?
https://github.com/flamewow/nestjs-asyncapi/pull/473/files#diff-bc32787f3b434f34f1cf6480e670abbcd25092915b971c0f234579c24c8379b6R16

{
  '0': {
    channel: 'test',
    message: {
      payload: [Object],
      name: 'HealthController#getHealth',
      headers: undefined
    },
    type: 'sub'
  }
}

as a result I get this error:

const metadataCombined = [...metadataOperations || [], ...metadataSubs || [], ...metadataPubs || []];
                                                                           ^
TypeError: (metadataSubs || []) is not iterable
    at exploreAsyncApiOperationMetadata (/nestjs-asyncapi/dist/lib/explorers/asyncapi-operation.explorer.js:23:76)

I tried reproducing the same behaviour in the sample app but I couldn't, it returns an array as it should.

@MaksimKiselev
Copy link
Author

@Pedr0Rocha are you build your nest app with tsc compiler?

Can you please provide your tsconfig* files, package.json (deps, devDeps)?

@Pedr0Rocha
Copy link
Contributor

It was fixed here: 5069e22

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants