Skip to content

Instantly share code, notes, and snippets.

@mhmohona
Last active November 21, 2023 16:20
Show Gist options
  • Select an option

  • Save mhmohona/41f377afdc94f1cb21dea3a8e21dc51a to your computer and use it in GitHub Desktop.

Select an option

Save mhmohona/41f377afdc94f1cb21dea3a8e21dc51a to your computer and use it in GitHub Desktop.
Storyline for AsyncAPI learning path

Story: Eve Helps Chan Fix His Spaceship

1. Info (Metadata about the API):

  • Think of this as the name tag on Chan's spaceship. It tells you the spaceship's name and which version it is (like if it's a newer or older model). In our API, the "info" section does something similar. It gives a title and version for the API, like a name tag so everyone knows what they're working with.

2. Channels (Communication channels in the API):

  • Imagine the spaceship has different radio stations for talking to different parts of space. Each station (or channel) is for talking about specific things. In our API, "channels" are like these radio stations. They're paths for sending specific types of messages. Each channel is for a different topic, just like how each radio station on Chan's spaceship talks to different planets or stars.

3. Components (Reusable parts of the API):

  • This is like having a toolbox on the spaceship. In this toolbox, there are tools and parts that Eve can use over and over for different repairs. The "components" section in our API is similar. It has reusable parts like message definitions and rules (schemas) that you can use many times in different places of the API.

4. Tags (Categorizing operations):

  • Tags are like labels on the spaceship's control panel. Each label helps Eve quickly find what she needs to fix the spaceship. In the API, "tags" help categorize different operations, making it easier for people to find and understand what each part of the API does.

5. Operations (Defined actions within channels):

  • Operations are like instructions or actions that can be done on the spaceship. For example, there might be an operation for sending a message to Earth. In our API, "operations" are defined within the channels and tell what actions can be done, like sending or receiving messages.

6. Messages (Content of the messages in operations):

  • Messages in our story are like the actual words Eve and Chan use when they talk through the spaceship's radio. In the API, "messages" are defined in operations and describe what the messages sent or received look like, including their structure and content.

7. Schemas (Structure of message content):

  • Schemas are like blueprints or instructions for how to build or fix parts of the spaceship. They make sure that everything fits together correctly. In the API, "schemas" are in the components section and describe how the message content should be structured, like whether it's a simple text or a more complex list of instructions.

So, in our story, Eve uses all these parts - like the name tag, radio stations, toolbox, labels, instructions, words in their messages, and blueprints - to understand and fix the problem with Chan's spaceship engine. Similarly, in an API, developers use info, channels, components, tags, operations, messages, and schemas to make sure the API works properly and does what it's supposed to do.

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