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

[Docs] Feedback on /docs/tutorials/websocket - Thu, 21 Mar 2024 01:29:38 GMT #2946

Closed
derberg opened this issue May 8, 2024 · 2 comments · Fixed by #2977
Closed

[Docs] Feedback on /docs/tutorials/websocket - Thu, 21 Mar 2024 01:29:38 GMT #2946

derberg opened this issue May 8, 2024 · 2 comments · Fixed by #2977
Labels
area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. bug

Comments

@derberg
Copy link
Member

derberg commented May 8, 2024

Discussed in https://github.com/orgs/asyncapi/discussions/1116

Originally posted by asyncapi-bot March 21, 2024
The final code document does not validate in Studio.

note from Lukasz

it is related to https://www.asyncapi.com/docs/tutorials/websocket

and yeah, we have formatting issue, indentation issue to be precize

correct document that should be in last code sample is:

asyncapi: '3.0.0'
info:
  title: Create an AsyncAPI document for a Slackbot with WebSocket
  version: '1.0.0'
  description:  |
    The Heart-Counter manages popular messages in a Slack workspace by monitoring message reaction data.
servers:
  production:
    host: wss-primary.slack.com
    pathname: /link
    protocol: wss
    description: Slack's server in Socket Mode for real-time communication
channels:
  root:
    address: /
    messages:
      hello:
        $ref: '#/components/messages/hello'
      reaction:
        $ref: '#/components/messages/reaction'
    bindings:
      ws:
        query:
          type: object
          description: Tokens are produced in the WebSocket URL generated from the [apps.connections.open](https://api.slack.com/methods/apps.connections.open) method from Slack’s API
          properties:
            ticket:
              type: string
              description: Temporary token generated when connection is initiated
              const: '13748dac-b866-4ea7-b98e-4fb7895c0a7f'
            app_id:
              type: string
              description: Unique identifier assigned to the Slack app
              const: 'fe684dfa62159c6ac646beeac31c8f4ef415e4f39c626c2dbd1530e3a690892f'
operations:
  helloListener:
    action: receive
    channel:
      $ref: '#/channels/root'
    messages:
      - $ref: '#/channels/root/messages/hello'
  reactionListener:
    action: receive
    channel:
      $ref: '#/channels/root'
    messages:
      - $ref: '#/channels/root/messages/reaction'
components:
  messages:
    reaction:
      summary: Action triggered when the channel receives a new reaction-added event
      payload:
        $ref: '#/components/schemas/reaction'
    hello:
      summary: Action triggered when a successful WebSocket connection is established
      payload:
        $ref: '#/components/schemas/hello'
  schemas:
    hello:
      type: object
      properties:
        type:
          type: string
          description: A hello string confirming WebSocket connection
        connection_info:
          type: object
          properties:
            app_id:
              type: string
            num_connections:
              type: integer
            debug_info:
              type: object
              properties:
                host:
                  type: string
                started:
                  type: string
                build_number:
                  type: integer
                approximate_connection_time:
                  type: integer
    reaction:
      type: object
      properties:
        user:
          type: string
          description: User ID who performed this event
        reaction:
          type: string
          description: The only reaction that we need is a heart emoji
        item_user:
          type: string
          description: User ID that created the original item that has been reacted to
        item:
          type: object
          properties:
            channel:
              type: string
              description: Channel information of original message
            ts:
              type: string
              description: Timestamp information of original message
        event_ts:
          type: string
          description: Reaction timestamp 

works well in https://studio.asyncapi.com/

provide fix in https://github.com/asyncapi/website/blob/master/pages/docs/tutorials/websocket/index.md

@derberg derberg added bug area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. labels May 8, 2024
@derberg derberg transferred this issue from asyncapi/community May 8, 2024
@VaishnaviNandakumar
Copy link
Collaborator

Hello @derberg! I don't see anyone assigned to this yet, I can take it up.

Copy link
Member Author

derberg commented May 15, 2024

@VaishnaviNandakumar awesome, please go ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants