asyncapi: 3.0.0
info:
title: User Notification Service
version: 1.0.0
description: |
Service that handles user notifications through various channels
including email, SMS, and push notifications.
channels:
user/signup:
address: user/signup
messages:
UserSignedUp:
$ref: '#/components/messages/UserSignedUp'
notification/send:
address: notification/send
messages:
SendNotification:
$ref: '#/components/messages/SendNotification'
operations:
onUserSignup:
action: receive
channel:
$ref: '#/channels/user~1signup'
summary: User signup event
description: Triggered when a user signs up for the service
sendNotification:
action: send
channel:
$ref: '#/channels/notification~1send'
summary: Send notification
description: Send a notification to a user
components:
messages:
UserSignedUp:
name: UserSignedUp
title: User Signed Up
summary: User has signed up for the service
contentType: application/json
payload:
$ref: '#/components/schemas/User'
SendNotification:
name: SendNotification
title: Send Notification
summary: Send a notification to a user
contentType: application/json
payload:
$ref: '#/components/schemas/Notification'
schemas:
User:
type: object
properties:
id:
type: string
format: uuid
description: Unique identifier for the user
email:
type: string
format: email
description: User's email address
name:
type: string
description: User's full name
createdAt:
type: string
format: date-time
description: When the user was created
required:
- id
- email
- name
Notification:
type: object
properties:
userId:
type: string
format: uuid
description: ID of the user to notify
type:
type: string
enum: [email, sms, push]
description: Type of notification to send
message:
type: string
description: Message content
priority:
type: string
enum: [low, medium, high, urgent]
default: medium
description: Priority level of the notification
required:
- userId
- type
- message