asyncapi / asyncapi-react

React component for rendering documentation from your specification in real-time in the browser. It also provides a WebComponent and bundle for Angular and Vue
https://asyncapi.github.io/asyncapi-react/
Apache License 2.0
188 stars 127 forks source link

Hide Message ID block if messageId is not set #1049

Closed Vaniog closed 1 month ago

Vaniog commented 2 months ago

Description

Remove block [Message ID] presented on the photo, if message has no property "messageId" (as in attached specification)

Reasons

This duplicate information and take a lot of space

Attachments

asyncapi: 3.0.0
info:
  title: Hello world application
  version: '0.1.0'
channels:
  hello:
    address: 'hello'
    messages:
      sayHelloMessage:
        payload:
          type: string
operations:
  receiveHello:
    action: 'receive'
    channel:
      $ref: '#/channels/hello'

image

github-actions[bot] commented 2 months ago

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.

ItshMoh commented 2 months ago

Hey @Vaniog can you explain what are you trying to say in the issue. As the spec you have shared is containing the {messagId} . For this doc it is 'sayHelloMessage' . You can refer here. let me know what are your thoughts.

Vaniog commented 2 months ago

In this case messageId is same as message name. But you can set messageId property, as in spec below.

components:
  messages:
    sayHelloMessage:
      messageId: notSayHelloMessage
      payload:
        type: object
        properties:
          name:
            type: string

So message name and messageId will be different In case, which i provided in issue, these properties are same, so i dont want to see both of them in message header (screenshot)

ItshMoh commented 2 months ago

Hey @Vaniog In asyncapi version 3.0.0 it is not valid. You can't specify the messageID in the spec. Here You can again refer. I have tried you spec in studio. messageID_conf

Vaniog commented 2 months ago

Yes. And so displaying message name and messageId separately in viewer is deprecated too.

Vaniog commented 2 months ago

But you can see duplicate ids here https://github.com/asyncapi/asyncapi-react/blob/master/library/src/containers/Messages/Message.tsx#L62, and here https://github.com/asyncapi/asyncapi-react/blob/master/library/src/containers/Messages/Message.tsx#L97

ItshMoh commented 2 months ago

Hey @AceTheCreator Would it be fine to remove one of the messageID, as both are the same. Is it for some other purposes? what's your suggestion, if it is a valid issue or not?

AceTheCreator commented 2 months ago

@ItshMoh, yea, we should remove the first one 👍🏾

asyncapi-bot commented 1 month ago

:tada: This issue has been resolved in version 2.3.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: