Skip to content

Commit

Permalink
feat: update the http asyncapi file to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Nov 23, 2023
1 parent 80adf7e commit 2245075
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 75 deletions.
157 changes: 105 additions & 52 deletions examples/anime-http/client/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -1,82 +1,135 @@
asyncapi: 2.4.0
asyncapi: 3.0.0
info:
title: AsyncAPI IMDB client
version: 1.0.0
description: This app creates a client that subscribes to the server for getting the top 10 trending/upcoming anime.
description: >-
This app creates a client that subscribes to the server for getting the top
10 trending/upcoming anime.
servers:
trendingAnime:
url: http://localhost:8081
host: 'localhost:8081'
protocol: http
security:
- token: []
- userPass: []
- apiKey: []
- UserOrPassKey: []
- oauth:
- write:pets
- read:pets
- $ref: '#/components/securitySchemes/token'
- $ref: '#/components/securitySchemes/userPass'
- $ref: '#/components/securitySchemes/apiKey'
- $ref: '#/components/securitySchemes/UserOrPassKey'
- type: oauth2
flows:
implicit:
authorizationUrl: 'https://example.com/api/oauth/dialog'
availableScopes:
'write:pets': modify pets in your account
'read:pets': read your pets
authorizationCode:
authorizationUrl: 'https://example.com/api/oauth/dialog'
tokenUrl: 'https://example.com/api/oauth/dialog'
availableScopes:
'delete:pets': modify pets in your account
'update:pets': read your pets
scopes:
- 'write:pets'
- 'read:pets'
testwebhook:
url: ws://localhost:9000
host: 'localhost:9000'
protocol: ws
x-remoteServers:
- trendingAnime
channels:
/test:
test:
address: '/test'
bindings:
ws:
bindingVersion: 0.1.0
publish:
operationId: index
message:
$ref: '#/components/messages/test'
messages:
testMessage:
$ref: '#/components/messages/testMessage'
trendingAnime:
address: '/trendingAnime'
bindings:
http:
type: request
method: POST
bindingVersion: 0.1.0
servers:
- trendingAnime
publish:
operationId: trendingAnimeListRecieverController
message:
$ref: "../server/asyncapi.yaml#/components/messages/trendingAnime"
subscribe:
message:
payload:
type: object
- $ref: '#/servers/trendingAnime'
messages:
trendingAnimeMessage:
$ref: '#/components/messages/trendingAnimeMessage'
operations:
index:
action: receive
channel:
$ref: '#/channels/test'
messages:
- $ref: '#/components/messages/testMessage'
trendingAnimeListRecieverController:
action: receive
channel:
$ref: '#/channels/trendingAnime'
messages:
- $ref: '#/components/messages/trendingAnimeMessage'
reply:
channel:
$ref: '#/channels/trendingAnime'
messages:
- $ref: '#/components/messages/trendingAnimeReply'
components:
messages:
test:
testMessage:
summary: ping client
payload:
type: object
trendingAnimeMessage:
summary: Data required to populate trending anime
payload:
type: object
required:
- name
- rating
- genre
- studio
properties:
name:
type: string
description: Name of the anime.
rating:
type: string
description: Rating of the show.
genre:
type: string
description: The genre of anime.
studio:
type: string
description: The studio of anime.
trendingAnimeReply:
payload:
type: object
securitySchemes:
token:
type: http
scheme: bearer
bearerFormat: JWT
userPass:
type: userPassword
apiKey:
type: httpApiKey
name: api_key
in: query
UserOrPassKey:
type: apiKey
in: user
oauth:
token:
type: http
scheme: bearer
bearerFormat: JWT
userPass:
type: userPassword
apiKey:
type: httpApiKey
name: api_key
in: query
UserOrPassKey:
type: apiKey
in: user
oauth:
type: oauth2
flows:
implicit:
authorizationUrl: https://example.com/api/oauth/dialog
scopes:
write:pets: modify pets in your account
read:pets: read your pets
authorizationUrl: 'https://example.com/api/oauth/dialog'
availableScopes:
'write:pets': modify pets in your account
'read:pets': read your pets
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/dialog
scopes:
delete:pets: modify pets in your account
update:pets: read your pets

authorizationUrl: 'https://example.com/api/oauth/dialog'
tokenUrl: 'https://example.com/api/oauth/dialog'
availableScopes:
'delete:pets': modify pets in your account
'update:pets': read your pets
x-remoteServers:
- trendingAnime
60 changes: 37 additions & 23 deletions examples/anime-http/server/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
asyncapi: 2.6.0
asyncapi: 3.0.0
info:
title: AsyncAPI IMDB server
version: 1.0.0
description: This app is a dummy server that would stream the trending/upcoming anime.
servers:
trendingAnimeServer:
url: 'http://localhost:8081'
host: 'localhost:8081'
protocol: http
security:
- token: []
- userPass: []
- apiKey: []
- UserOrPassKey: []
- cert: []
- oauth: []
- $ref: '#/components/securitySchemes/token'
- $ref: '#/components/securitySchemes/userPass'
- $ref: '#/components/securitySchemes/apiKey'
- $ref: '#/components/securitySchemes/UserOrPassKey'
- $ref: '#/components/securitySchemes/cert'
- $ref: '#/components/securitySchemes/oauth'
channels:
trendingAnime:
address: /trendingAnime
messages:
trendingAnimeController.message:
$ref: '#/components/messages/trendingAnime'
subscribe.message:
payload:
type: object
bindings:
http:
type: request
Expand All @@ -25,20 +32,27 @@ channels:
$ref: '#/components/schemas/request'
body:
$ref: '#/components/schemas/request'
publish:
operationId: trendingAnimeController
message:
$ref: '#/components/messages/trendingAnime'
subscribe:
message:
payload:
type: object
operations:
trendingAnimeController:
action: receive
channel:
$ref: '#/channels/trendingAnime'
messages:
- $ref: '#/components/messages/trendingAnime'
reply:
channel:
$ref: "#/channels/trendingAnime"
messages:
- $ref: '#/components/messages/trendingAnimeReply'
components:
messages:
trendingAnime:
summary: Data required to populate trending anime
payload:
$ref: '#/components/schemas/request'
trendingAnimeReply:
payload:
type: object
schemas:
request:
type: object
Expand Down Expand Up @@ -77,10 +91,10 @@ components:
cert:
type: X509
oauth:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://example.com/api/oauth/dialog
scopes:
delete:pets: modify pets in your account
update:pets: read your pets
type: oauth2
flows:
clientCredentials:
tokenUrl: 'https://example.com/api/oauth/dialog'
availableScopes:
'delete:pets': modify pets in your account
'update:pets': read your pets

0 comments on commit 2245075

Please sign in to comment.