Skip to content

Parser do not validate if channel that is referenced in reply with location has null in address #876

Open

Description

@derberg

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

Activity

  1. jonaslagoni commented on Nov 9, 2023

    @jonaslagoni
    Member

    We need a new spectral rule for this. To solve this issue:

    This issue is marked as good first issue, but it's a hard one!

    Remember to target the next-major-spec branch.

  2. jonaslagoni commented on Nov 9, 2023

    @jonaslagoni
    Member

    /gfi typescript

  3. added
    area/typescriptSpecify what technical area given issue relates to. Its goal is to ease filtering good first issues.
    on Nov 9, 2023
  4. jonaslagoni commented on Nov 23, 2023

    @jonaslagoni
    Member

    You can go ahead and work on it @Min2who, we dont really assign issues 😄

  5. github-actions commented on Mar 23, 2024

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴

    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 ❤️

  6. ashmit-coder commented on Mar 29, 2024

    @ashmit-coder

    hey @jonaslagoni is this still relevant?

  7. ibishal commented on Jun 15, 2024

    @ibishal

    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.

  8. smoya commented on Jun 17, 2024

    @smoya
    Member

    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.

  9. ibishal commented on Jun 20, 2024

    @ibishal

    @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

  10. smoya commented on Jun 21, 2024

    @smoya
    Member

    @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 😆

  11. ibishal commented on Jun 21, 2024

    @ibishal

    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

  12. github-actions commented on Oct 20, 2024

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity 😴

    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 ❤️

  13. buidlLabs3 commented on Aug 13, 2026

    @buidlLabs3

    Hi maintainers, I would like to work on this as my first AsyncAPI contribution.

    I reviewed the current repository structure and the earlier guidance on this issue. The v3 ruleset now lives under packages/parser/src/ruleset/v3 on master, so my proposed approach is:

    1. Add v3 ruleset tests that reproduce an operation whose reply.address.location is defined while its referenced reply channel has a non-null address.
    2. Add a focused Spectral function under packages/parser/src/ruleset/v3/functions and register it in the v3 core ruleset.
    3. Validate root and component operations/reply channels, reporting the diagnostic at the reply address/channel path.
    4. Add valid cases for a null channel address and invalid cases for a non-null address, including referenced-channel coverage where supported by the current ruleset resolution model.
    5. Run the focused ruleset tests, lint, type checks, and the repository test suite.

    Could you please confirm that the issue is still valid, that master is now the correct target branch, and whether external/component reply-channel references should be handled in this rule? I will wait for confirmation before opening a PR.

  14. DRafi2006 commented on Sep 5, 2026

    @DRafi2006

    Hi! I’d like to work on this issue. This would be my first contribution to AsyncAPI. I’ll investigate the validation logic, add the necessary fix and tests, and submit a PR. Please assign this issue to me if it’s available.

  15. be-student commented on Sep 6, 2026

    @be-student

    I’m implementing the v3 Spectral rule on next-major-spec following the maintainer guidance above. I’ll cover root and component channels, allow null or omitted channel addresses, and report the diagnostic at the reply channel reference.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/typescriptSpecify what technical area given issue relates to. Its goal is to ease filtering good first issues.bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions