Skip to content

Commit

Permalink
chore: update examples so messages reference channel messages (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg authored Nov 29, 2023
1 parent 5fb88a0 commit 1a8c669
Show file tree
Hide file tree
Showing 21 changed files with 111 additions and 111 deletions.
6 changes: 3 additions & 3 deletions examples/anyof-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ channels:
test:
address: test
messages:
publish.message:
testMessages:
$ref: '#/components/messages/testMessages'
operations:
test.publish:
test:
action: receive
channel:
$ref: '#/channels/test'
messages:
- $ref: '#/components/messages/testMessages'
- $ref: '#/channels/test/messages/testMessages'
components:
messages:
testMessages:
Expand Down
2 changes: 1 addition & 1 deletion examples/application-headers-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ operations:
Inform about environmental lighting conditions of a particular
streetlight.
messages:
- $ref: '#/components/messages/lightMeasured'
- $ref: '#/channels/lightingMeasured/messages/lightMeasured'
components:
messages:
lightMeasured:
Expand Down
4 changes: 2 additions & 2 deletions examples/correlation-id-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ operations:
Inform about environmental lighting conditions of a particular
streetlight.
messages:
- $ref: '#/components/messages/lightMeasured'
- $ref: '#/channels/lightingMeasured/messages/lightMeasured'
dimLight:
action: send
channel:
$ref: '#/channels/lightsDim'
messages:
- $ref: '#/components/messages/dimLight'
- $ref: '#/channels/lightsDim/messages/dimLight'
components:
messages:
lightMeasured:
Expand Down
4 changes: 2 additions & 2 deletions examples/gitter-streaming-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ operations:
http:
method: POST
messages:
- $ref: '#/components/messages/chatMessage'
- $ref: '#/components/messages/heartbeat'
- $ref: '#/channels/rooms/messages/chatMessage'
- $ref: '#/channels/rooms/messages/heartbeat'
components:
securitySchemes:
httpBearerToken:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ operations:
channel:
$ref: '#/channels/currencyExchange'
messages:
- $ref: '#/components/messages/pong'
- $ref: '#/channels/currencyExchange/messages/pong'
messages:
- $ref: '#/components/messages/ping'
- $ref: '#/channels/currencyExchange/messages/ping'
sendHeartbeat:
action: send
channel:
$ref: '#/channels/currencyExchange'
messages:
- $ref: '#/components/messages/heartbeat'
- $ref: '#/channels/currencyExchange/messages/heartbeat'
systemStatus:
action: send
channel:
$ref: '#/channels/currencyExchange'
messages:
- $ref: '#/components/messages/systemStatus'
- $ref: '#/channels/currencyExchange/messages/systemStatus'
receiveSubscribeRequest:
action: receive
channel:
Expand All @@ -72,10 +72,10 @@ operations:
channel:
$ref: '#/channels/currencyExchange'
messages:
- $ref: '#/components/messages/subscriptionStatus'
- $ref: '#/components/messages/dummyCurrencyInfo'
- $ref: '#/channels/currencyExchange/messages/subscriptionStatus'
- $ref: '#/channels/currencyExchange/messages/dummyCurrencyInfo'
messages:
- $ref: '#/components/messages/subscribe'
- $ref: '#/channels/currencyExchange/messages/subscribe'
receiveUnsubscribeRequest:
action: receive
channel:
Expand All @@ -84,9 +84,9 @@ operations:
channel:
$ref: '#/channels/currencyExchange'
messages:
- $ref: '#/components/messages/subscriptionStatus'
- $ref: '#/channels/currencyExchange/messages/subscriptionStatus'
messages:
- $ref: '#/components/messages/unsubscribe'
- $ref: '#/channels/currencyExchange/messages/unsubscribe'


components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ operations:
channel:
$ref: '#/channels/currencyInfo'
messages:
- $ref: '#/components/messages/subscriptionStatus'
- $ref: '#/channels/currencyInfo/messages/subscriptionStatus'


components:
Expand Down
4 changes: 2 additions & 2 deletions examples/mercure-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ operations:
channel:
$ref: '#/channels/books'
messages:
- $ref: '#/components/messages/book'
- $ref: '#/channels/books/messages/book'
SendBooksInfo:
action: send
channel:
$ref: '#/channels/books'
messages:
- $ref: '#/components/messages/book'
- $ref: '#/channels/books/messages/book'
components:
messages:
book:
Expand Down
6 changes: 3 additions & 3 deletions examples/not-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ channels:
test:
address: test
messages:
publish.message:
testMessages:
$ref: '#/components/messages/testMessages'
operations:
test.publish:
onTestMsg:
action: receive
channel:
$ref: '#/channels/test'
messages:
- $ref: '#/components/messages/testMessages'
- $ref: '#/channels/test/messages/testMessages'
components:
messages:
testMessages:
Expand Down
16 changes: 8 additions & 8 deletions examples/oneof-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ channels:
test:
address: test
messages:
publish.message:
testMessages:
$ref: '#/components/messages/testMessages'
test2:
address: test2
messages:
subscribe.message.0:
objectWithKey:
payload:
$ref: '#/components/schemas/objectWithKey'
subscribe.message.1:
objectWithKey2:
payload:
$ref: '#/components/schemas/objectWithKey2'
operations:
test.publish:
onTestMsg:
action: receive
channel:
$ref: '#/channels/test'
messages:
- $ref: '#/components/messages/testMessages'
test2.subscribe:
- $ref: '#/channels/test/messages/testMessages'
sendTest:
action: send
channel:
$ref: '#/channels/test2'
messages:
- $ref: '#/channels/test2/messages/subscribe.message.0'
- $ref: '#/channels/test2/messages/subscribe.message.1'
- $ref: '#/channels/test2/messages/objectWithKey'
- $ref: '#/channels/test2/messages/objectWithKey2'
components:
messages:
testMessages:
Expand Down
10 changes: 5 additions & 5 deletions examples/operation-security-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ info:
This contract defines HTTP Push notification for application authorization
revocation topic
channels:
AUTHORIZATION_REVOCATION:
authRevoke:
address: AUTHORIZATION_REVOCATION
messages:
subscribe.message:
message:
$ref: '#/components/messages/message'
operations:
AUTHORIZATION_REVOCATION.subscribe:
sendAuthRevoke:
action: send
channel:
$ref: '#/channels/AUTHORIZATION_REVOCATION'
$ref: '#/channels/authRevoke'
security:
- type: oauth2
description: The oauth security descriptions
Expand All @@ -31,7 +31,7 @@ operations:
method: POST

messages:
- $ref: '#/components/messages/message'
- $ref: '#/channels/authRevoke/messages/message'
components:
messages:
message:
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ operations:
channel:
$ref: '#/channels/userSignedup'
messages:
- $ref: '#/components/messages/UserSignedUp'
- $ref: '#/channels/userSignedup/messages/UserSignedUp'
components:
messages:
UserSignedUp:
Expand Down
94 changes: 47 additions & 47 deletions examples/slack-rtm-asyncapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,58 +115,58 @@ operations:
channel:
$ref: '#/channels/root'
messages:
- $ref: '#/components/messages/outgoingMessage'
- $ref: '#/channels/root/messages/outgoingMessage'
sendMessages:
action: send
channel:
$ref: '#/channels/root'
messages:
- $ref: '#/components/messages/hello'
- $ref: '#/components/messages/connectionError'
- $ref: '#/components/messages/accountsChanged'
- $ref: '#/components/messages/botAdded'
- $ref: '#/components/messages/botChanged'
- $ref: '#/components/messages/channelArchive'
- $ref: '#/components/messages/channelCreated'
- $ref: '#/components/messages/channelDeleted'
- $ref: '#/components/messages/channelHistoryChanged'
- $ref: '#/components/messages/channelJoined'
- $ref: '#/components/messages/channelLeft'
- $ref: '#/components/messages/channelMarked'
- $ref: '#/components/messages/channelRename'
- $ref: '#/components/messages/channelUnarchive'
- $ref: '#/components/messages/commandsChanged'
- $ref: '#/components/messages/dndUpdated'
- $ref: '#/components/messages/dndUpdatedUser'
- $ref: '#/components/messages/emailDomainChanged'
- $ref: '#/components/messages/emojiRemoved'
- $ref: '#/components/messages/emojiAdded'
- $ref: '#/components/messages/fileChange'
- $ref: '#/components/messages/fileCommentAdded'
- $ref: '#/components/messages/fileCommentDeleted'
- $ref: '#/components/messages/fileCommentEdited'
- $ref: '#/components/messages/fileCreated'
- $ref: '#/components/messages/fileDeleted'
- $ref: '#/components/messages/filePublic'
- $ref: '#/components/messages/fileShared'
- $ref: '#/components/messages/fileUnshared'
- $ref: '#/components/messages/goodbye'
- $ref: '#/components/messages/groupArchive'
- $ref: '#/components/messages/groupClose'
- $ref: '#/components/messages/groupHistoryChanged'
- $ref: '#/components/messages/groupJoined'
- $ref: '#/components/messages/groupLeft'
- $ref: '#/components/messages/groupMarked'
- $ref: '#/components/messages/groupOpen'
- $ref: '#/components/messages/groupRename'
- $ref: '#/components/messages/groupUnarchive'
- $ref: '#/components/messages/imClose'
- $ref: '#/components/messages/imCreated'
- $ref: '#/components/messages/imMarked'
- $ref: '#/components/messages/imOpen'
- $ref: '#/components/messages/manualPresenceChange'
- $ref: '#/components/messages/memberJoinedChannel'
- $ref: '#/components/messages/message'
- $ref: '#/channels/root/messages/hello'
- $ref: '#/channels/root/messages/connectionError'
- $ref: '#/channels/root/messages/accountsChanged'
- $ref: '#/channels/root/messages/botAdded'
- $ref: '#/channels/root/messages/botChanged'
- $ref: '#/channels/root/messages/channelArchive'
- $ref: '#/channels/root/messages/channelCreated'
- $ref: '#/channels/root/messages/channelDeleted'
- $ref: '#/channels/root/messages/channelHistoryChanged'
- $ref: '#/channels/root/messages/channelJoined'
- $ref: '#/channels/root/messages/channelLeft'
- $ref: '#/channels/root/messages/channelMarked'
- $ref: '#/channels/root/messages/channelRename'
- $ref: '#/channels/root/messages/channelUnarchive'
- $ref: '#/channels/root/messages/commandsChanged'
- $ref: '#/channels/root/messages/dndUpdated'
- $ref: '#/channels/root/messages/dndUpdatedUser'
- $ref: '#/channels/root/messages/emailDomainChanged'
- $ref: '#/channels/root/messages/emojiRemoved'
- $ref: '#/channels/root/messages/emojiAdded'
- $ref: '#/channels/root/messages/fileChange'
- $ref: '#/channels/root/messages/fileCommentAdded'
- $ref: '#/channels/root/messages/fileCommentDeleted'
- $ref: '#/channels/root/messages/fileCommentEdited'
- $ref: '#/channels/root/messages/fileCreated'
- $ref: '#/channels/root/messages/fileDeleted'
- $ref: '#/channels/root/messages/filePublic'
- $ref: '#/channels/root/messages/fileShared'
- $ref: '#/channels/root/messages/fileUnshared'
- $ref: '#/channels/root/messages/goodbye'
- $ref: '#/channels/root/messages/groupArchive'
- $ref: '#/channels/root/messages/groupClose'
- $ref: '#/channels/root/messages/groupHistoryChanged'
- $ref: '#/channels/root/messages/groupJoined'
- $ref: '#/channels/root/messages/groupLeft'
- $ref: '#/channels/root/messages/groupMarked'
- $ref: '#/channels/root/messages/groupOpen'
- $ref: '#/channels/root/messages/groupRename'
- $ref: '#/channels/root/messages/groupUnarchive'
- $ref: '#/channels/root/messages/imClose'
- $ref: '#/channels/root/messages/imCreated'
- $ref: '#/channels/root/messages/imMarked'
- $ref: '#/channels/root/messages/imOpen'
- $ref: '#/channels/root/messages/manualPresenceChange'
- $ref: '#/channels/root/messages/memberJoinedChannel'
- $ref: '#/channels/root/messages/message'
components:
securitySchemes:
token:
Expand Down
16 changes: 8 additions & 8 deletions examples/social-media/backend/asyncapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ channels:
notifyAllCommentLiked:
address: comment/liked
messages:
subscribe.message:
commentLiked:
$ref: '../common/messages.yaml#/commentLiked'
description: Notify all the services that a comment has been liked.
servers:
- $ref: '#/servers/mosquitto'
newLikeComment:
address: like/comment
messages:
publish.message:
likeComment:
$ref: '../common/messages.yaml#/likeComment'
description: When a comment like is received from the frontend.
servers:
- $ref: '#/servers/websiteWebSocketServer'
commentsCountChange:
address: 'comment/{commentId}/changed'
messages:
publish.message:
commentChanged:
$ref: '../common/messages.yaml#/commentChanged'
description: >-
When an event from the broker arrives telling us to update the comment
Expand All @@ -51,7 +51,7 @@ channels:
updateCommentsCount:
address: update/comment/likes
messages:
subscribe.message:
updateCommentLikes:
$ref: '../common/messages.yaml#/updateCommentLikes'
description: Update comment likes count in the frontend.
servers:
Expand All @@ -62,22 +62,22 @@ operations:
channel:
$ref: '#/channels/notifyAllCommentLiked'
messages:
- $ref: '../common/messages.yaml#/commentLiked'
- $ref: '#/channels/notifyAllCommentLiked/messages/commentLiked'
receiveCommentLike:
action: receive
channel:
$ref: '#/channels/newLikeComment'
messages:
- $ref: '../common/messages.yaml#/likeComment'
- $ref: '#/channels/newLikeComment/messages/likeComment'
receiveCommentChange:
action: receive
channel:
$ref: '#/channels/commentsCountChange'
messages:
- $ref: '../common/messages.yaml#/commentChanged'
- $ref: '#/channels/commentsCountChange/messages/commentChanged'
sendCommentLikeUpdate:
action: send
channel:
$ref: '#/channels/updateCommentsCount'
messages:
- $ref: '../common/messages.yaml#/updateCommentLikes'
- $ref: '#/channels/updateCommentsCount/messages/updateCommentLikes'
Loading

0 comments on commit 1a8c669

Please sign in to comment.