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

Operation Names lost in navigation replaced by channel value instead #1156

Open
francocm opened this issue Nov 19, 2024 · 5 comments
Open

Operation Names lost in navigation replaced by channel value instead #1156

francocm opened this issue Nov 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@francocm
Copy link

Describe the bug

The operations navigation in Studio lists the operations by channel value instead of operation name, making the navigation unusable.

This used to work fine in the latest (old) Docker image published here (sha256:8c96f5b7058053be2e7715ce223b2d347e03bdad87f0732c6378569119cc7564), but seems broken in the most latest Studio tag @asyncapi/[email protected].

I don't know where, in-between, this broke nor why.

How to Reproduce

The following AsyncAPI YAML can be used to reproduce the problem. Use the same YAML on the old (Docker Hub) version, vs the the latest 0.22.1 version.

example.yaml (click to expand)
asyncapi: 3.0.0
info:
  title: example Events
  version: 0.0.1-DRAFT
servers:
  kafka-local:
    host: localhost:9092
    protocol: kafka
    description: Kafka broker (local dev)
    security:
      - $ref: '#/components/securitySchemes/plainSecurity'
defaultContentType: application/json
channels:
  ExampleEvents:
    address: example.foo.events
    description: The Kafka topic on which example events are published on.
    messages:
      exampleCreatedEvent:
        $ref: '#/components/messages/exampleCreatedEvent'
      exampleUpdatedEvent:
        $ref: '#/components/messages/exampleUpdatedEvent'
operations:
  'example.created':
    action: send
    channel:
      $ref: '#/channels/ExampleEvents'
    messages:
      - $ref: '#/channels/ExampleEvents/messages/exampleCreatedEvent'
  'example.updated':
    action: send
    channel:
      $ref: '#/channels/ExampleEvents'
    messages:
      - $ref: '#/channels/ExampleEvents/messages/exampleUpdatedEvent'
components:
  schemas:
    exampleBody:
      type: object
      properties:
        foo:
          type: string
  messages:
    exampleCreatedEvent:
      name: exampleCreatedEvent
      title: Example Created Event
      contentType: application/json
      headers:
        type: object
        properties:
          eventType:
            type: string
            const: example.created
      payload:
        $ref: '#/components/schemas/exampleBody'
    exampleUpdatedEvent:
      name: exampleCreatedEvent
      title: Example Created Event
      contentType: application/json
      headers:
        type: object
        properties:
          eventType:
            type: string
            const: example.updated
      payload:
        $ref: '#/components/schemas/exampleBody'
  securitySchemes:
    plainSecurity:
      type: plain
      description: Plain unauthenticated connection

More specifically from the YAML above, the following subset controlled those values:

operations:
  'example.created':
    action: send
    # other values
  'example.updated':
    action: send
    # other values

Expected behaviour

Screenshot 2024-11-19 at 18 28 54

Actual behaviour

Screenshot 2024-11-19 at 18 28 23

Notice how the navigation lists each operation as example.foo.events, making them indistinguishable from each other.


I don't know whether this might be because I am not operating it correctly, but I can detect nothing wrong in the schema I am using in my approach and it used to work in older versions of Studio. I am also happy to accept feedback on changes in schema that might resolve this.

My use-case ultimately is:

  • I have 1 Kafka topic (which I take is a channel in AsyncAPI world), on which I can publish different payloads (messages) based on different scenarios (operations)
    • In this simplified example, the main distinction in the output is the header called eventType
  • I want to show the different event types in Studio, and map each to the respective details

I have also used operation.title based on the AsyncAPI 3.0.0 schema, but it made no difference.

@francocm francocm added the bug Something isn't working label Nov 19, 2024
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.

@immortal121
Copy link

Is anyone currently working on this issue? If not, I'd like to take it on.

@immortal121
Copy link

@francocm the issue is resolved with latest version released , you can check it once , thank you

@immortal121
Copy link

Dear Maintainer, This Bug is No More, You can Close it Right Now !

@francocm
Copy link
Author

@immortal121

Thanks for jumping onto this!

The latest tag is 0.22.1 released last October, so I take it it's not in the latest release yet?

I've built now from master (cd9081f782960b5786726ef8360fe57572deb90a) instead instead of 0.22.1 and the behaviour is as before.

comment

@francocm the issue is resolved with latest version released , you can check it once , thank you

I also see no commits by you merged into master here: https://github.com/asyncapi/studio/commits/master/?author=immortal121

Have you raised a PR anywhere? I'm also interested into what the fix was.

Thanks

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
Status: Backlog
Development

No branches or pull requests

2 participants