Parser do not validate if channel that is referenced in reply with location has `null` in address
Like in the title
So I have such document
asyncapi: 3.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
replyChannel:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
userSignedup:
address: user/signedup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
operations:
sendUserSignedup:
action: send
channel:
$ref: '#/channels/userSignedup'
messages:
- $ref: '#/channels/userSignedup/messages/UserSignedUp'
reply:
channel:
$ref: '#/channels/replyChannel'
address:
location: '$message.header#/REPLY_TOPIC'
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
it should not be a valid document. Spec explicitly defines that if in reply you specify dynamic location of the response address (reply.address) then referenced channel must have undefined address or address: null
We need a new spectral rule for this. To solve this issue:
- Create a new spectral rule that targets v3: https://github.com/asyncapi/parser-js/blob/next-major-spec/src/ruleset/ruleset.ts#L10
- Create a new spectral function similar to: https://github.com/asyncapi/parser-js/blob/d614ffa239f1daae6f343a8aabf24a55c99800bd/src/ruleset/functions/unusedComponent.ts#L7
- Make the function match all operations that define
replyandaddressto check for whether the associatedchannelhasaddresswithnullvalue. - Adjust the spectral rule to use the new spectral function.
This issue is marked as good first issue, but it's a hard one!
Remember to target the next-major-spec branch.
/gfi typescript
You can go ahead and work on it @Min2who, we dont really assign issues 😄
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
hey @jonaslagoni is this still relevant?
Hey @smoya is this issue still valid because in above asyncapi document the studio gives this error Operation message does not belong to the specified channel.
Hey @smoya is this issue still valid because in above asyncapi document the studio gives this error
Operation message does not belong to the specified channel.
@ibishal I fixed the example. Now you will see Studio (or directly the Parser-JS) won't complain about anything when it should.
@ibishal I fixed the example. Now you will see Studio (or directly the Parser-JS) won't complain about anything when it should.
@smoya the example defined in the issue still gives the same error
@ibishal I fixed the example. Now you will see Studio (or directly the Parser-JS) won't complain about anything when it should.
@smoya the example defined in the issue still gives the same error
For some reason, didn't copy the right one. Now I promise it works, please check again 😆
For some reason, didn't copy the right one. Now I promise it works, please check again 😆
It worksss but @smoya the spec with the issue mismatch
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: