From a7b285d54730f265341a3622489eced5be7fe6ac Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Tue, 28 Nov 2023 07:29:26 +0600 Subject: [PATCH 01/13] added index --- 100-level-AsyncAPI-Intro/index.json | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 100-level-AsyncAPI-Intro/index.json diff --git a/100-level-AsyncAPI-Intro/index.json b/100-level-AsyncAPI-Intro/index.json new file mode 100644 index 0000000..978c999 --- /dev/null +++ b/100-level-AsyncAPI-Intro/index.json @@ -0,0 +1,27 @@ +{ + "title": "100 Level AsyncAPI Intro", + "description": "Introduction of AsyncAPI - 100 Level", + "details": { + "intro": { + "text": "intro.md" + }, + "steps": [ + { + "text": "step1.md" + }, + { + "text": "step2.md" + }, + { + "text": "step3.md" + } + ], + "finish": { + "text": "finish.md" + } + }, + "backend": { + "imageid": "ubuntu" + } + } + \ No newline at end of file From b3dde0dad98845f9a39f96050209f35461a5617c Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Tue, 28 Nov 2023 16:06:22 +0600 Subject: [PATCH 02/13] module 3 --- 100-level-AsyncAPI-Intro/step2.md | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 100-level-AsyncAPI-Intro/step2.md diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md new file mode 100644 index 0000000..d0ef8c4 --- /dev/null +++ b/100-level-AsyncAPI-Intro/step2.md @@ -0,0 +1,35 @@ +## Deep Dive into Various Components of AsyncAPI + +1. **Info (Metadata about the API):** + +Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the "info" section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with [Source 11](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md). + +2. **Servers (Communication servers in the API):** + +Imagine that Chan's spaceship communicates with different parts of the universe through various servers. In AsyncAPI, the "servers" section describes the servers our API will communicate with, including their URLs, protocols, and descriptions [Source 3](https://nordicapis.com/how-to-write-your-first-asyncapi-specification/). + +3. **Channels (Communication channels in the API):** + +The spaceship's radio stations, which correspond to specific topics, are akin to the "channels" in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. + +4. **Tags (Categorizing operations):** + +Tags in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier for developers to understand what each part of the API does. Each tag consists of a name and an optional description. + +5. **Components (Reusable parts of the API):** + +This is like the toolbox in Chan's spaceship. It contains reusable parts like message definitions and schemas that can be used across the API. Each component is linked to a particular schema, which describes the structure of the message content. + +## How to Define Operations, Messages, and Schemas + +1. **Operations (Defined actions within channels):** + +Operations in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. + +2. **Messages (Content of the operations):** + +Messages in AsyncAPI are the content exchanged during operations, just like the words Eve and Chan use to communicate. They describe the structure and content of the messages sent or received. + +3. **Schemas (Structure of message content):** + +Schemas in AsyncAPI are like the blueprints for the spaceship. They define the structure of the message content, ensuring that everything fits together correctly. Each schema is associated with a component and describes the structure and content of the messages. From c48006441344bd6fdbbcf43ae73b1142a2d7ac43 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Tue, 28 Nov 2023 22:18:07 +0600 Subject: [PATCH 03/13] update --- 100-level-AsyncAPI-Intro/index.json | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 100-level-AsyncAPI-Intro/index.json diff --git a/100-level-AsyncAPI-Intro/index.json b/100-level-AsyncAPI-Intro/index.json deleted file mode 100644 index 978c999..0000000 --- a/100-level-AsyncAPI-Intro/index.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "title": "100 Level AsyncAPI Intro", - "description": "Introduction of AsyncAPI - 100 Level", - "details": { - "intro": { - "text": "intro.md" - }, - "steps": [ - { - "text": "step1.md" - }, - { - "text": "step2.md" - }, - { - "text": "step3.md" - } - ], - "finish": { - "text": "finish.md" - } - }, - "backend": { - "imageid": "ubuntu" - } - } - \ No newline at end of file From 1d2306be669d68fab8a4035ccd315661a8e2ec1e Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Tue, 28 Nov 2023 22:25:13 +0600 Subject: [PATCH 04/13] remove numbers --- 100-level-AsyncAPI-Intro/step2.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index d0ef8c4..37d4e11 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -1,35 +1,35 @@ ## Deep Dive into Various Components of AsyncAPI -1. **Info (Metadata about the API):** +- **Info (Metadata about the API):** -Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the "info" section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with [Source 11](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md). +Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the "info" section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with. -2. **Servers (Communication servers in the API):** +- **Servers (Communication servers in the API):** -Imagine that Chan's spaceship communicates with different parts of the universe through various servers. In AsyncAPI, the "servers" section describes the servers our API will communicate with, including their URLs, protocols, and descriptions [Source 3](https://nordicapis.com/how-to-write-your-first-asyncapi-specification/). +Imagine that Chan's spaceship communicates with different parts of the universe through various servers. In AsyncAPI, the "servers" section describes the servers our API will communicate with, including their URLs, protocols, and descriptions. -3. **Channels (Communication channels in the API):** +- **Channels (Communication channels in the API):** The spaceship's radio stations, which correspond to specific topics, are akin to the "channels" in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. -4. **Tags (Categorizing operations):** +- **Tags (Categorizing operations):** Tags in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier for developers to understand what each part of the API does. Each tag consists of a name and an optional description. -5. **Components (Reusable parts of the API):** +- **Components (Reusable parts of the API):** This is like the toolbox in Chan's spaceship. It contains reusable parts like message definitions and schemas that can be used across the API. Each component is linked to a particular schema, which describes the structure of the message content. ## How to Define Operations, Messages, and Schemas -1. **Operations (Defined actions within channels):** +- **Operations (Defined actions within channels):** Operations in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. -2. **Messages (Content of the operations):** +- **Messages (Content of the operations):** Messages in AsyncAPI are the content exchanged during operations, just like the words Eve and Chan use to communicate. They describe the structure and content of the messages sent or received. -3. **Schemas (Structure of message content):** +- **Schemas (Structure of message content):** Schemas in AsyncAPI are like the blueprints for the spaceship. They define the structure of the message content, ensuring that everything fits together correctly. Each schema is associated with a component and describes the structure and content of the messages. From 91cf0913d986a6ac9b3f8c67da3e1a8f93a855d1 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Wed, 29 Nov 2023 12:37:04 +0600 Subject: [PATCH 05/13] update storyline --- 100-level-AsyncAPI-Intro/step2.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index 37d4e11..fe10b13 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -1,35 +1,42 @@ ## Deep Dive into Various Components of AsyncAPI +In the control room of Chan's spaceship, Eve is assisting Chan in setting up the communication system using AsyncAPI. They're working together to ensure they can maintain contact even when Chan is light-years away. Eve explains the different components of AsyncAPI as they program each part. + +## Understanding AsyncAPI Components through Chan and Eve's Programming Session + - **Info (Metadata about the API):** -Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the "info" section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with. +Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the `info` section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with. - **Servers (Communication servers in the API):** -Imagine that Chan's spaceship communicates with different parts of the universe through various servers. In AsyncAPI, the "servers" section describes the servers our API will communicate with, including their URLs, protocols, and descriptions. +Imagine that Chan's spaceship communicates with different parts of the universe through various servers. In AsyncAPI, the `servers` section describes the servers our API will communicate with, including their URLs, protocols, and descriptions. - **Channels (Communication channels in the API):** -The spaceship's radio stations, which correspond to specific topics, are akin to the "channels" in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. +The spaceship's radio stations, which correspond to specific topics, are akin to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. - **Tags (Categorizing operations):** -Tags in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier for developers to understand what each part of the API does. Each tag consists of a name and an optional description. +`Tags` in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier for developers to understand what each part of the API does. Each tag consists of a name and an optional description. - **Components (Reusable parts of the API):** -This is like the toolbox in Chan's spaceship. It contains reusable parts like message definitions and schemas that can be used across the API. Each component is linked to a particular schema, which describes the structure of the message content. +`Component` is like the toolbox in Chan's spaceship. It contains reusable parts like message definitions and schemas that can be used across the API. Each component is linked to a particular schema, which describes the structure of the message content. -## How to Define Operations, Messages, and Schemas +## Programming Operations, Messages, and Schemas - **Operations (Defined actions within channels):** -Operations in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. +`Operations` in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. - **Messages (Content of the operations):** -Messages in AsyncAPI are the content exchanged during operations, just like the words Eve and Chan use to communicate. They describe the structure and content of the messages sent or received. +`Messages` in AsyncAPI are the content exchanged during operations, just like the words Eve and Chan use to communicate. They describe the structure and content of the messages sent or received. - **Schemas (Structure of message content):** -Schemas in AsyncAPI are like the blueprints for the spaceship. They define the structure of the message content, ensuring that everything fits together correctly. Each schema is associated with a component and describes the structure and content of the messages. +`Schemas` in AsyncAPI are like the blueprints for the spaceship. They define the structure of the message content, ensuring that everything fits together correctly. Each schema is associated with a component and describes the structure and content of the messages. + +## Chan and Eve's AsyncAPI Document +They write the following code to set up their communication system: From 002da053ea53250d80fac635b96939dfae143221 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Sun, 10 Dec 2023 16:24:19 +0600 Subject: [PATCH 06/13] add handson excercise --- .../assets/chan-to-capuccinova.yaml | 0 100-level-AsyncAPI-Intro/step2.md | 197 +++++++++++++++++- 2 files changed, 189 insertions(+), 8 deletions(-) create mode 100644 100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml diff --git a/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml b/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml new file mode 100644 index 0000000..e69de29 diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index fe10b13..3705d7e 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -1,6 +1,3 @@ -## Deep Dive into Various Components of AsyncAPI - -In the control room of Chan's spaceship, Eve is assisting Chan in setting up the communication system using AsyncAPI. They're working together to ensure they can maintain contact even when Chan is light-years away. Eve explains the different components of AsyncAPI as they program each part. ## Understanding AsyncAPI Components through Chan and Eve's Programming Session @@ -8,35 +5,219 @@ In the control room of Chan's spaceship, Eve is assisting Chan in setting up the Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the `info` section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with. +```yml +asyncapi: '3.0.0' +info: + title: Space Communication API + version: '1.0.0' + description: API for communication between spaceship and control room +``` + - **Servers (Communication servers in the API):** -Imagine that Chan's spaceship communicates with different parts of the universe through various servers. In AsyncAPI, the `servers` section describes the servers our API will communicate with, including their URLs, protocols, and descriptions. +Imagine that Chan's spaceship communicates with different parts of the universe, including Capuccinova and other regions, through various servers. In AsyncAPI, the `servers` section describes the servers our API will communicate with, including their URLs, protocols, and descriptions. + +```yml +servers: + production: + url: mqtt://test.mosquitto.org + protocol: mqtt + description: Production server +``` - **Channels (Communication channels in the API):** -The spaceship's radio stations, which correspond to specific topics, are akin to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. +The spaceship's radio stations, which correspond to specific topics like communicating with Capuccinova, are akin to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. + +```yml +channels: + chat: + description: Channel for sending and receiving chat messages + address: chat/{roomId} + parameters: + roomId: + description: The ID of the chat room + schema: + type: string + send: + message: + $ref: '#/components/messages/ChatMessage' +``` - **Tags (Categorizing operations):** `Tags` in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier for developers to understand what each part of the API does. Each tag consists of a name and an optional description. +```yml +tags: + - name: chat + description: Operations related to chat +``` + - **Components (Reusable parts of the API):** `Component` is like the toolbox in Chan's spaceship. It contains reusable parts like message definitions and schemas that can be used across the API. Each component is linked to a particular schema, which describes the structure of the message content. +```yml +components: + messages: + ChatMessage: + name: ChatMessage + title: Chat Message + contentType: application/json + payload: + $ref: '#/components/schemas/ChatMessagePayload' + schemas: + ChatMessagePayload: + type: object + properties: + userId: + type: string + description: The ID of the user who sent the message + message: + type: string + description: The chat message +``` + ## Programming Operations, Messages, and Schemas - **Operations (Defined actions within channels):** `Operations` in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. +```yml +channels: + chat: + description: Channel for sending and receiving chat messages + address: chat/{roomId} + parameters: + roomId: + description: The ID of the chat room + schema: + type: string + send: + operationId: sendChatMessage + summary: Send a chat message + tags: + - chat + message: + $ref: '#/components/messages/ChatMessage' +``` - **Messages (Content of the operations):** -`Messages` in AsyncAPI are the content exchanged during operations, just like the words Eve and Chan use to communicate. They describe the structure and content of the messages sent or received. +`Messages` in AsyncAPI are the content exchanged during operations, just like the words Eve from Capuccinova and Chan from Brownieterra use to communicate. They describe the structure and content of the messages sent or received. + + +```yml +components: + messages: + ChatMessage: + name: ChatMessage + title: Chat Message + contentType: application/json + payload: + $ref: '#/components/schemas/ChatMessagePayload' +``` - **Schemas (Structure of message content):** `Schemas` in AsyncAPI are like the blueprints for the spaceship. They define the structure of the message content, ensuring that everything fits together correctly. Each schema is associated with a component and describes the structure and content of the messages. -## Chan and Eve's AsyncAPI Document -They write the following code to set up their communication system: +```yml +components: + schemas: + ChatMessagePayload: + type: object + properties: + userId: + type: string + description: The ID of the user who sent the message + message: + type: string + description: The chat message +``` + +### Hands-on Exercise: Guiding Chan's Interstellar Messages to Eve + +Chan is determined to improve his messaging capabilities with Eve on Capuccinova. He plans to add a new property for a username and create a new channel for messages. After updating his AsyncAPI document with these new details, Chan faces some issues while trying to validate the changes in AsyncAPI Studio. He needs your help to ensure smooth communication with Eve. + +#### Exercise 1: Crafting the Initial Message + +Chan is preparing to send his inaugural space message to Eve on Capuccinova and realizes he needs to include a `spacename` in the message format. + +**Your Mission:** + +1. On the KillerCoda terminal, use the command `nano chan-to-capuccinova.yaml` to edit Chan's AsyncAPI document. + +2. Locate the `payload` section under the `ChatMessagePayload` schema. It will look something like this: + + ```yaml + ChatMessagePayload: + type: object + properties: + userId: + type: string + description: The ID of the user who sent the message + message: + type: string + description: The chat message + ``` + +3. Insert a new property for the `spacename` within the payload. Your updated payload section should now include: + ```yaml + spacename: + type: string + description: The unique spacename identifier for the message + ``` + + Ensure that this new property aligns correctly and follows the structure of the existing properties. + +4. Save your changes and exit the editor. In Nano, do this by pressing `Ctrl + X`, then `Y` to confirm, and `Enter` to save. + +5. Notify Chan that his message structure is updated and he is ready to communicate with Eve on Capuccinova! + +### Hands-on Exercise 2: Establishing a New Channel for Messages to Brownieterra + +After the successful attempt, Chan is now eager to establish a new communication channel for sending messages to his home planet, Brownieterra. He's unsure about correctly configuring this new channel in his AsyncAPI document and needs your expertise to set up this vital link. + +**Your Mission:** + +1. Using the KillerCoda terminal, open Chan's AsyncAPI document with the command `nano chan-to-capuccinova.yaml`. + +2. Add a new channel for communication with Brownieterra. Locate the `channels` section in the document, which might look something like this: + + ```yaml + channels: + chat: + description: Channel for sending and receiving chat messages + address: chat/{roomId} + parameters: + roomId: + description: The ID of the chat room + schema: + type: string + send: + message: + $ref: '#/components/messages/ChatMessage' + ``` + +3. Introduce a new channel entry for Brownieterra. Ensure it includes a suitable description, address, and message structure reference. Your new channel could be structured as follows: + ```yaml + brownieterra-chat: + description: Channel for sending messages to Brownieterra + address: brownieterra-chat/{spacename} + parameters: + spacename: + description: The unique spacename identifier for Brownieterra communication + schema: + type: string + send: + message: + $ref: '#/components/messages/BrownieterraChatMessage' + ``` + + Pay attention to the correct structure and adherence to AsyncAPI specifications. + +4. Save the changes in the document by pressing `Ctrl + X`, then `Y` to confirm, and `Enter` to save. + +5. Inform Chan that the new channel for communication with Brownieterra is set up in his AsyncAPI document, enabling him to extend his reach beyond Capuccinova! \ No newline at end of file From 8b2c671cf15691dd4435148404447b448c228227 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Mon, 11 Dec 2023 06:24:19 +0600 Subject: [PATCH 07/13] update format --- .../assets/chan-to-capuccinova.yaml | 36 +++++++++++ 100-level-AsyncAPI-Intro/step2.md | 61 +++++++++---------- 2 files changed, 65 insertions(+), 32 deletions(-) diff --git a/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml b/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml index e69de29..ab57f59 100644 --- a/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml +++ b/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml @@ -0,0 +1,36 @@ +asyncapi: 3.0.0 +info: + title: Space Communication API + version: '1.0.0' + description: API for communication between Chan's spaceship and Capuccinova + +servers: + production: + host: space.mosquitto.org + protocol: mqtt + description: Production server for space communication + +channels: + roomidchat: + address: chat/{roomId} + messages: + chatMessage: + name: ChatMessage + payload: + type: object + properties: + userId: + type: string + description: The ID of the user who sent the message + message: + type: string + description: The chat message + spacename: + type: string + description: The unique spacename identifier for the message +operations: + sendChatMessage: + action: 'send' + summary: Send a chat message to a specific room + channel: + $ref: '#/channels/roomidchat' \ No newline at end of file diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index 3705d7e..85c0f9b 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -3,45 +3,51 @@ - **Info (Metadata about the API):** -Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the `info` section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and contact details. This metadata helps developers understand the basic details of the API they're working with. +Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the `info` section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and description. This metadata helps developers understand the basic details of the API they're working with. ```yml asyncapi: '3.0.0' info: title: Space Communication API version: '1.0.0' - description: API for communication between spaceship and control room + description: API for communication between Chan's spaceship and Capuccinova ``` - **Servers (Communication servers in the API):** -Imagine that Chan's spaceship communicates with different parts of the universe, including Capuccinova and other regions, through various servers. In AsyncAPI, the `servers` section describes the servers our API will communicate with, including their URLs, protocols, and descriptions. +Imagine that Chan's spaceship communicates with Eve on Capuccinova through various servers. In AsyncAPI, the `servers` section describes the servers our API will communicate with, including their hosts, protocols, and descriptions. ```yml servers: production: - url: mqtt://test.mosquitto.org + host: space.mosquitto.org protocol: mqtt - description: Production server + description: Production server for space communication ``` - **Channels (Communication channels in the API):** -The spaceship's radio stations, which correspond to specific topics like communicating with Capuccinova, are akin to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel is associated with a particular topic, just as each radio station communicates with a particular planet or star. +The spaceship's radio stations, which correspond to specific topics like communicating with Capuccinova, are simmilar to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel uses an address, which is a template for the URI of the server, and can have variables inside curly braces. ```yml channels: - chat: - description: Channel for sending and receiving chat messages + roomidchat: address: chat/{roomId} - parameters: - roomId: - description: The ID of the chat room - schema: - type: string - send: - message: - $ref: '#/components/messages/ChatMessage' + messages: + chatMessage: + name: ChatMessage + payload: + type: object + properties: + userId: + type: string + description: The ID of the user who sent the message + message: + type: string + description: The chat message + spacename: + type: string + description: The unique spacename identifier for the message ``` - **Tags (Categorizing operations):** @@ -86,22 +92,12 @@ components: `Operations` in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. ```yml -channels: - chat: - description: Channel for sending and receiving chat messages - address: chat/{roomId} - parameters: - roomId: - description: The ID of the chat room - schema: - type: string - send: - operationId: sendChatMessage - summary: Send a chat message - tags: - - chat - message: - $ref: '#/components/messages/ChatMessage' +operations: + sendChatMessage: + action: 'send' + summary: Send a chat message to a specific room + channel: + $ref: '#/channels/roomidchat' ``` - **Messages (Content of the operations):** @@ -202,6 +198,7 @@ After the successful attempt, Chan is now eager to establish a new communication ``` 3. Introduce a new channel entry for Brownieterra. Ensure it includes a suitable description, address, and message structure reference. Your new channel could be structured as follows: + ```yaml brownieterra-chat: description: Channel for sending messages to Brownieterra From 6900094f29072966cec37405d39a191c383aaf84 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Mon, 11 Dec 2023 11:57:29 +0600 Subject: [PATCH 08/13] change file structure --- 100-level-AsyncAPI-Intro/index.json | 32 +++++++++++++++++++ .../assets/chan-to-capuccinova.yaml | 0 100-level-AsyncAPI-Intro/step2/background.sh | 9 ++++++ .../{step2.md => step2/text.md} | 0 4 files changed, 41 insertions(+) create mode 100644 100-level-AsyncAPI-Intro/index.json rename 100-level-AsyncAPI-Intro/{ => step2}/assets/chan-to-capuccinova.yaml (100%) create mode 100644 100-level-AsyncAPI-Intro/step2/background.sh rename 100-level-AsyncAPI-Intro/{step2.md => step2/text.md} (100%) diff --git a/100-level-AsyncAPI-Intro/index.json b/100-level-AsyncAPI-Intro/index.json new file mode 100644 index 0000000..2ccfe09 --- /dev/null +++ b/100-level-AsyncAPI-Intro/index.json @@ -0,0 +1,32 @@ +{ + "title": "100 Level AsyncAPI Intro", + "description": "Introduction of AsyncAPI - 100 Level", + "details": { + "intro": { + "text": "intro.md", + "foreground": "setup_node.sh" + }, + "steps": [ + { + "title": "Event-Driven Architectures", + "text": "step1.md" + }, + { + "title": "AsyncAPI Specification", + "text": "step2/text.md", + "background": "step2/background.sh" + }, + { + "title": "Creating and Validating AsyncAPI Code and Documents", + "text": "step3.md" + } + ], + "finish": { + "text": "finish.md" + } + }, + "backend": { + "imageid": "ubuntu" + } + } + \ No newline at end of file diff --git a/100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml b/100-level-AsyncAPI-Intro/step2/assets/chan-to-capuccinova.yaml similarity index 100% rename from 100-level-AsyncAPI-Intro/assets/chan-to-capuccinova.yaml rename to 100-level-AsyncAPI-Intro/step2/assets/chan-to-capuccinova.yaml diff --git a/100-level-AsyncAPI-Intro/step2/background.sh b/100-level-AsyncAPI-Intro/step2/background.sh new file mode 100644 index 0000000..8b0f085 --- /dev/null +++ b/100-level-AsyncAPI-Intro/step2/background.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Clone the specified repository +git clone https://github.com/mhmohona/interactive-learning-path + +# Change directory into the cloned repository +cd interactive-learning-path/asyncapi/step1/assets + +# Any additional background setup tasks can be added here diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2/text.md similarity index 100% rename from 100-level-AsyncAPI-Intro/step2.md rename to 100-level-AsyncAPI-Intro/step2/text.md From 28a9be0f15d13a159b32ddbb770f29178559174d Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Mon, 11 Dec 2023 11:58:36 +0600 Subject: [PATCH 09/13] update path --- 100-level-AsyncAPI-Intro/step2/background.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/100-level-AsyncAPI-Intro/step2/background.sh b/100-level-AsyncAPI-Intro/step2/background.sh index 8b0f085..9617d72 100644 --- a/100-level-AsyncAPI-Intro/step2/background.sh +++ b/100-level-AsyncAPI-Intro/step2/background.sh @@ -1,9 +1,9 @@ #!/bin/bash # Clone the specified repository -git clone https://github.com/mhmohona/interactive-learning-path +git clone https://github.com/asyncapi/learning-paths # Change directory into the cloned repository -cd interactive-learning-path/asyncapi/step1/assets +cd learning-path/100-level-AsyncAPI-Intro/step1/assets # Any additional background setup tasks can be added here From 3f8b6b51484b9ec2062b32578b49feca37c36cc2 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Tue, 12 Dec 2023 08:30:36 +0600 Subject: [PATCH 10/13] update handson exercise --- 100-level-AsyncAPI-Intro/index.json | 32 ----- .../{step2/text.md => step2.md} | 136 ++++++++++-------- .../step2/assets/chan-to-capuccinova.yaml | 36 ----- 100-level-AsyncAPI-Intro/step2/background.sh | 9 -- 4 files changed, 80 insertions(+), 133 deletions(-) delete mode 100644 100-level-AsyncAPI-Intro/index.json rename 100-level-AsyncAPI-Intro/{step2/text.md => step2.md} (57%) delete mode 100644 100-level-AsyncAPI-Intro/step2/assets/chan-to-capuccinova.yaml delete mode 100644 100-level-AsyncAPI-Intro/step2/background.sh diff --git a/100-level-AsyncAPI-Intro/index.json b/100-level-AsyncAPI-Intro/index.json deleted file mode 100644 index 2ccfe09..0000000 --- a/100-level-AsyncAPI-Intro/index.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "title": "100 Level AsyncAPI Intro", - "description": "Introduction of AsyncAPI - 100 Level", - "details": { - "intro": { - "text": "intro.md", - "foreground": "setup_node.sh" - }, - "steps": [ - { - "title": "Event-Driven Architectures", - "text": "step1.md" - }, - { - "title": "AsyncAPI Specification", - "text": "step2/text.md", - "background": "step2/background.sh" - }, - { - "title": "Creating and Validating AsyncAPI Code and Documents", - "text": "step3.md" - } - ], - "finish": { - "text": "finish.md" - } - }, - "backend": { - "imageid": "ubuntu" - } - } - \ No newline at end of file diff --git a/100-level-AsyncAPI-Intro/step2/text.md b/100-level-AsyncAPI-Intro/step2.md similarity index 57% rename from 100-level-AsyncAPI-Intro/step2/text.md rename to 100-level-AsyncAPI-Intro/step2.md index 85c0f9b..30602d5 100644 --- a/100-level-AsyncAPI-Intro/step2/text.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -133,72 +133,77 @@ components: description: The chat message ``` -### Hands-on Exercise: Guiding Chan's Interstellar Messages to Eve +--- -Chan is determined to improve his messaging capabilities with Eve on Capuccinova. He plans to add a new property for a username and create a new channel for messages. After updating his AsyncAPI document with these new details, Chan faces some issues while trying to validate the changes in AsyncAPI Studio. He needs your help to ensure smooth communication with Eve. +Certainly! Here's the updated hands-on exercise, guiding you through the entire process of creating and configuring Chan's AsyncAPI document for communication with Capuccinova and beyond. -#### Exercise 1: Crafting the Initial Message +### Chan's Galactic Coding Adventure: Crafting the Capuccinova Connection -Chan is preparing to send his inaugural space message to Eve on Capuccinova and realizes he needs to include a `spacename` in the message format. +#### Prologue: A New Beginning in the Stars -**Your Mission:** +Chan embarks on a mission to establish a sophisticated communication system with Eve on Capuccinova. With your expertise in AsyncAPI, you'll assist him in creating a robust AsyncAPI document from scratch. -1. On the KillerCoda terminal, use the command `nano chan-to-capuccinova.yaml` to edit Chan's AsyncAPI document. +--- -2. Locate the `payload` section under the `ChatMessagePayload` schema. It will look something like this: +#### Chapter 1: Initiating the Capuccinova Communication Link - ```yaml - ChatMessagePayload: - type: object - properties: - userId: - type: string - description: The ID of the user who sent the message - message: - type: string - description: The chat message - ``` - -3. Insert a new property for the `spacename` within the payload. Your updated payload section should now include: - ```yaml - spacename: - type: string - description: The unique spacename identifier for the message - ``` - - Ensure that this new property aligns correctly and follows the structure of the existing properties. +**Your Mission: Creating the Base AsyncAPI Document** -4. Save your changes and exit the editor. In Nano, do this by pressing `Ctrl + X`, then `Y` to confirm, and `Enter` to save. +1. **Start the Journey**: In the KillerCoda terminal, create a new file by typing `nano chan-to-capuccinova.yaml`. -5. Notify Chan that his message structure is updated and he is ready to communicate with Eve on Capuccinova! - -### Hands-on Exercise 2: Establishing a New Channel for Messages to Brownieterra +2. **Lay the Cosmic Foundations**: Enter the basic AsyncAPI structure: + ```yaml + asyncapi: 3.0.0 + info: + title: Space Communication API + version: '1.0.0' + description: API for communication between Chan's spaceship and Capuccinova + + servers: + production: + host: space.mosquitto.org + protocol: mqtt + description: Production server for space communication -After the successful attempt, Chan is now eager to establish a new communication channel for sending messages to his home planet, Brownieterra. He's unsure about correctly configuring this new channel in his AsyncAPI document and needs your expertise to set up this vital link. + channels: + roomidchat: + address: chat/{roomId} + messages: + chatMessage: + name: ChatMessage + payload: + type: object + properties: + userId: + type: string + description: The ID of the user who sent the message + message: + type: string + description: The chat message + spacename: + type: string + description: The unique spacename identifier for the message + + operations: + sendChatMessage: + action: 'send' + summary: Send a chat message to a specific room + channel: + $ref: '#/channels/roomidchat' + ``` +3. **Seal the Galactic Document**: Save (`Ctrl + O`, `Enter`) and exit Nano (`Ctrl + X`). -**Your Mission:** +4. **Inform Chan**: Let him know that the foundation for his AsyncAPI document is set. -1. Using the KillerCoda terminal, open Chan's AsyncAPI document with the command `nano chan-to-capuccinova.yaml`. +#### Chapter 2: Expanding the Network to Brownieterra -2. Add a new channel for communication with Brownieterra. Locate the `channels` section in the document, which might look something like this: +**Your Mission: Adding a New Channel and Defining Operations for Brownieterra** - ```yaml - channels: - chat: - description: Channel for sending and receiving chat messages - address: chat/{roomId} - parameters: - roomId: - description: The ID of the chat room - schema: - type: string - send: - message: - $ref: '#/components/messages/ChatMessage' - ``` +After successfully laying the groundwork for communication with Capuccinova, Chan is now eager to extend his AsyncAPI document to include a channel for Brownieterra. -3. Introduce a new channel entry for Brownieterra. Ensure it includes a suitable description, address, and message structure reference. Your new channel could be structured as follows: +1. **Reopen the AsyncAPI Document**: Use the command `nano chan-to-capuccinova.yaml` to edit Chan's document. +2. **Create a New Communication Channel**: Add a channel for Brownieterra. This includes specifying the channel name, its address, and parameters: ```yaml brownieterra-chat: description: Channel for sending messages to Brownieterra @@ -208,13 +213,32 @@ After the successful attempt, Chan is now eager to establish a new communication description: The unique spacename identifier for Brownieterra communication schema: type: string - send: - message: - $ref: '#/components/messages/BrownieterraChatMessage' ``` - Pay attention to the correct structure and adherence to AsyncAPI specifications. +3. **Define Operations for the New Channel**: Under the `operations` section, specify how messages will be sent over the new Brownieterra channel. For example: + ```yaml + operations: + sendToBrownieterra: + action: send + summary: Send a message to Brownieterra + channel: + $ref: '#/channels/brownieterra-chat' + ``` + +4. **Save and Exit**: After adding the new channel and defining its operations, save your changes (`Ctrl + O`, `Enter`) and exit Nano (`Ctrl + X`). + +5. **Inform Chan**: Let Chan know that the new channel for Brownieterra has been successfully added and configured in his AsyncAPI document. + +#### Chapter 3: Perfecting the Message Structure + +**Your Mission: Enhancing Message Formats and Payloads** + +Chan wants to add more details to the message payloads for more personalized communication. + +1. **Access the AsyncAPI File**: Edit `chan-to-capuccinova.yaml` in Nano. + +2. **Refine the Message Payloads**: Update the payloads to include additional properties or modify existing ones to better suit the communication needs. -4. Save the changes in the document by pressing `Ctrl + X`, then `Y` to confirm, and `Enter` to save. +3. **Consolidate the Changes**: Save your modifications (`Ctrl + O`, `Enter`) and exit (`Ctrl + X`). -5. Inform Chan that the new channel for communication with Brownieterra is set up in his AsyncAPI document, enabling him to extend his reach beyond Capuccinova! \ No newline at end of file +4. **Update Chan**: Let him know that the message formats are now more detailed and well structured for both Capuccinova and Brownieterra. \ No newline at end of file diff --git a/100-level-AsyncAPI-Intro/step2/assets/chan-to-capuccinova.yaml b/100-level-AsyncAPI-Intro/step2/assets/chan-to-capuccinova.yaml deleted file mode 100644 index ab57f59..0000000 --- a/100-level-AsyncAPI-Intro/step2/assets/chan-to-capuccinova.yaml +++ /dev/null @@ -1,36 +0,0 @@ -asyncapi: 3.0.0 -info: - title: Space Communication API - version: '1.0.0' - description: API for communication between Chan's spaceship and Capuccinova - -servers: - production: - host: space.mosquitto.org - protocol: mqtt - description: Production server for space communication - -channels: - roomidchat: - address: chat/{roomId} - messages: - chatMessage: - name: ChatMessage - payload: - type: object - properties: - userId: - type: string - description: The ID of the user who sent the message - message: - type: string - description: The chat message - spacename: - type: string - description: The unique spacename identifier for the message -operations: - sendChatMessage: - action: 'send' - summary: Send a chat message to a specific room - channel: - $ref: '#/channels/roomidchat' \ No newline at end of file diff --git a/100-level-AsyncAPI-Intro/step2/background.sh b/100-level-AsyncAPI-Intro/step2/background.sh deleted file mode 100644 index 9617d72..0000000 --- a/100-level-AsyncAPI-Intro/step2/background.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# Clone the specified repository -git clone https://github.com/asyncapi/learning-paths - -# Change directory into the cloned repository -cd learning-path/100-level-AsyncAPI-Intro/step1/assets - -# Any additional background setup tasks can be added here From c4baab8b71879364d6afa00b6944a0cecf070fea Mon Sep 17 00:00:00 2001 From: Quetzalli Date: Fri, 26 Jan 2024 20:23:41 -0800 Subject: [PATCH 11/13] tw editorial rewrite --- 100-level-AsyncAPI-Intro/step2.md | 97 +++++++------------------------ 1 file changed, 22 insertions(+), 75 deletions(-) diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index 30602d5..d8e0d48 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -1,9 +1,9 @@ -## Understanding AsyncAPI Components through Chan and Eve's Programming Session +## Understanding AsyncAPI components -- **Info (Metadata about the API):** +- **Info** -Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the `info` section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and description. This metadata helps developers understand the basic details of the API they're working with. +Just as the name tag on Chan's spaceship provides essential details like the spaceship's name and model, the `info` section in AsyncAPI serves a similar purpose. It provides crucial information about the API, such as the title, version, and description. The `info` metadata helps developers understand the basic API details they're working with. ```yml asyncapi: '3.0.0' @@ -11,9 +11,8 @@ info: title: Space Communication API version: '1.0.0' description: API for communication between Chan's spaceship and Capuccinova -``` -- **Servers (Communication servers in the API):** +- **Servers** Imagine that Chan's spaceship communicates with Eve on Capuccinova through various servers. In AsyncAPI, the `servers` section describes the servers our API will communicate with, including their hosts, protocols, and descriptions. @@ -23,11 +22,10 @@ servers: host: space.mosquitto.org protocol: mqtt description: Production server for space communication -``` -- **Channels (Communication channels in the API):** +- **Channels** -The spaceship's radio stations, which correspond to specific topics like communicating with Capuccinova, are simmilar to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel uses an address, which is a template for the URI of the server, and can have variables inside curly braces. +The spaceship's radio stations, which correspond to specific topics like communicating with Capuccinova, are similar to the `channels` in AsyncAPI. These channels represent paths for sending specific types of messages. Each channel uses an address, which is a template for the URL of the server, and can have variables inside curly braces. ```yml channels: @@ -48,19 +46,17 @@ channels: spacename: type: string description: The unique spacename identifier for the message -``` -- **Tags (Categorizing operations):** +- **Tags** -`Tags` in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier for developers to understand what each part of the API does. Each tag consists of a name and an optional description. +`Tags` in AsyncAPI are like the labels on the spaceship's control panel. They help categorize different operations, making it easier to understand what each part of the API does. Each tag consists of a name and an optional description. ```yml tags: - name: chat description: Operations related to chat -``` -- **Components (Reusable parts of the API):** +- **Components** `Component` is like the toolbox in Chan's spaceship. It contains reusable parts like message definitions and schemas that can be used across the API. Each component is linked to a particular schema, which describes the structure of the message content. @@ -83,11 +79,10 @@ components: message: type: string description: The chat message -``` -## Programming Operations, Messages, and Schemas +## Operations, messages, and schemas -- **Operations (Defined actions within channels):** +- **Operations** `Operations` in AsyncAPI are like the instructions for the spaceship. They define what actions can be performed within each channel, such as sending or receiving messages. Each operation is associated with a message and a schema. @@ -98,8 +93,7 @@ operations: summary: Send a chat message to a specific room channel: $ref: '#/channels/roomidchat' -``` -- **Messages (Content of the operations):** +- **Messages** `Messages` in AsyncAPI are the content exchanged during operations, just like the words Eve from Capuccinova and Chan from Brownieterra use to communicate. They describe the structure and content of the messages sent or received. @@ -113,9 +107,8 @@ components: contentType: application/json payload: $ref: '#/components/schemas/ChatMessagePayload' -``` -- **Schemas (Structure of message content):** +- **Schemas** `Schemas` in AsyncAPI are like the blueprints for the spaceship. They define the structure of the message content, ensuring that everything fits together correctly. Each schema is associated with a component and describes the structure and content of the messages. @@ -131,27 +124,16 @@ components: message: type: string description: The chat message -``` ---- +Now it's time to help Chan establish a sophisticated communication system with Eve on Capuccinova. With your new expertise in AsyncAPI, you'll assist him in creating an AsyncAPI document from scratch. -Certainly! Here's the updated hands-on exercise, guiding you through the entire process of creating and configuring Chan's AsyncAPI document for communication with Capuccinova and beyond. -### Chan's Galactic Coding Adventure: Crafting the Capuccinova Connection +#### Exercise 1: Create AsyncAPI document -#### Prologue: A New Beginning in the Stars -Chan embarks on a mission to establish a sophisticated communication system with Eve on Capuccinova. With your expertise in AsyncAPI, you'll assist him in creating a robust AsyncAPI document from scratch. +1. In the KillerCoda terminal, create a new file by typing `nano chan-to-capuccinova.yaml`. ---- - -#### Chapter 1: Initiating the Capuccinova Communication Link - -**Your Mission: Creating the Base AsyncAPI Document** - -1. **Start the Journey**: In the KillerCoda terminal, create a new file by typing `nano chan-to-capuccinova.yaml`. - -2. **Lay the Cosmic Foundations**: Enter the basic AsyncAPI structure: +2. Enter the following AsyncAPI document structure: ```yaml asyncapi: 3.0.0 info: @@ -191,20 +173,14 @@ Chan embarks on a mission to establish a sophisticated communication system with channel: $ref: '#/channels/roomidchat' ``` -3. **Seal the Galactic Document**: Save (`Ctrl + O`, `Enter`) and exit Nano (`Ctrl + X`). - -4. **Inform Chan**: Let him know that the foundation for his AsyncAPI document is set. - -#### Chapter 2: Expanding the Network to Brownieterra -**Your Mission: Adding a New Channel and Defining Operations for Brownieterra** +#### Exercise 2: Add new channel and define operations** -After successfully laying the groundwork for communication with Capuccinova, Chan is now eager to extend his AsyncAPI document to include a channel for Brownieterra. +After successfully laying the groundwork for communication with Capuccinova, Chan is eager to extend his AsyncAPI document to include a channel for Brownieterra. -1. **Reopen the AsyncAPI Document**: Use the command `nano chan-to-capuccinova.yaml` to edit Chan's document. - -2. **Create a New Communication Channel**: Add a channel for Brownieterra. This includes specifying the channel name, its address, and parameters: - ```yaml +1. Run the command `nano chan-to-capuccinova.yaml` to edit Chan's document. +2. Add a channel for Brownieterra, specifying the channel name, its address, and parameters. +```yaml brownieterra-chat: description: Channel for sending messages to Brownieterra address: brownieterra-chat/{spacename} @@ -213,32 +189,3 @@ After successfully laying the groundwork for communication with Capuccinova, Cha description: The unique spacename identifier for Brownieterra communication schema: type: string - ``` - -3. **Define Operations for the New Channel**: Under the `operations` section, specify how messages will be sent over the new Brownieterra channel. For example: - ```yaml - operations: - sendToBrownieterra: - action: send - summary: Send a message to Brownieterra - channel: - $ref: '#/channels/brownieterra-chat' - ``` - -4. **Save and Exit**: After adding the new channel and defining its operations, save your changes (`Ctrl + O`, `Enter`) and exit Nano (`Ctrl + X`). - -5. **Inform Chan**: Let Chan know that the new channel for Brownieterra has been successfully added and configured in his AsyncAPI document. - -#### Chapter 3: Perfecting the Message Structure - -**Your Mission: Enhancing Message Formats and Payloads** - -Chan wants to add more details to the message payloads for more personalized communication. - -1. **Access the AsyncAPI File**: Edit `chan-to-capuccinova.yaml` in Nano. - -2. **Refine the Message Payloads**: Update the payloads to include additional properties or modify existing ones to better suit the communication needs. - -3. **Consolidate the Changes**: Save your modifications (`Ctrl + O`, `Enter`) and exit (`Ctrl + X`). - -4. **Update Chan**: Let him know that the message formats are now more detailed and well structured for both Capuccinova and Brownieterra. \ No newline at end of file From 028735fb8a4523624f751f8b448d6fb90276d935 Mon Sep 17 00:00:00 2001 From: Quetzalli Date: Fri, 26 Jan 2024 20:27:37 -0800 Subject: [PATCH 12/13] tiny code block fixes --- 100-level-AsyncAPI-Intro/step2.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index d8e0d48..a2dc2c4 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -11,6 +11,7 @@ info: title: Space Communication API version: '1.0.0' description: API for communication between Chan's spaceship and Capuccinova +``` - **Servers** @@ -22,6 +23,7 @@ servers: host: space.mosquitto.org protocol: mqtt description: Production server for space communication +``` - **Channels** @@ -46,6 +48,7 @@ channels: spacename: type: string description: The unique spacename identifier for the message +``` - **Tags** @@ -55,6 +58,7 @@ channels: tags: - name: chat description: Operations related to chat +``` - **Components** @@ -79,6 +83,7 @@ components: message: type: string description: The chat message +``` ## Operations, messages, and schemas @@ -93,6 +98,8 @@ operations: summary: Send a chat message to a specific room channel: $ref: '#/channels/roomidchat' +``` + - **Messages** `Messages` in AsyncAPI are the content exchanged during operations, just like the words Eve from Capuccinova and Chan from Brownieterra use to communicate. They describe the structure and content of the messages sent or received. @@ -107,6 +114,7 @@ components: contentType: application/json payload: $ref: '#/components/schemas/ChatMessagePayload' +``` - **Schemas** @@ -124,11 +132,12 @@ components: message: type: string description: The chat message +``` Now it's time to help Chan establish a sophisticated communication system with Eve on Capuccinova. With your new expertise in AsyncAPI, you'll assist him in creating an AsyncAPI document from scratch. -#### Exercise 1: Create AsyncAPI document +#### Exercise 1: Create an AsyncAPI document 1. In the KillerCoda terminal, create a new file by typing `nano chan-to-capuccinova.yaml`. @@ -189,3 +198,4 @@ After successfully laying the groundwork for communication with Capuccinova, Cha description: The unique spacename identifier for Brownieterra communication schema: type: string +``` From bc3faedb792741f5d32e1116ae36aca550c2f185 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Sat, 27 Jan 2024 10:49:42 +0600 Subject: [PATCH 13/13] fix url --- 100-level-AsyncAPI-Intro/step2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/100-level-AsyncAPI-Intro/step2.md b/100-level-AsyncAPI-Intro/step2.md index a2dc2c4..6ad976a 100644 --- a/100-level-AsyncAPI-Intro/step2.md +++ b/100-level-AsyncAPI-Intro/step2.md @@ -20,7 +20,7 @@ Imagine that Chan's spaceship communicates with Eve on Capuccinova through vario ```yml servers: production: - host: space.mosquitto.org + host: mqtt://localhost protocol: mqtt description: Production server for space communication ``` @@ -152,7 +152,7 @@ Now it's time to help Chan establish a sophisticated communication system with E servers: production: - host: space.mosquitto.org + host: mqtt://localhost protocol: mqtt description: Production server for space communication