All checks were successful
Quality Check / Linting (push) Successful in 59s
Quality Check / Testing (push) Successful in 59s
Quality Check / Static Analysis (push) Successful in 1m4s
Quality Check / Validate OAS (pull_request) Successful in 30s
Quality Check / Linting (pull_request) Successful in 58s
Quality Check / Testing (pull_request) Successful in 58s
Quality Check / Static Analysis (pull_request) Successful in 1m1s
Quality Check / Validate OAS (push) Successful in 3m48s
123 lines
3.1 KiB
YAML
123 lines
3.1 KiB
YAML
asyncapi: 3.0.0
|
|
info:
|
|
title: Game Server
|
|
version: 0.0.1
|
|
description: |
|
|
This is the Websocket Specification for the Tower Defence Game. <br>
|
|
Because of the limitations of Async API, we expect that the actual json,
|
|
which is send as payload to always contain a field called `$id` with
|
|
the corresponding `messageId`. <br>
|
|
The `messageId` should be handled case insensitive.
|
|
defaultContentType: application/json
|
|
servers:
|
|
localhost:
|
|
host: localhost:8080
|
|
protocol: ws
|
|
pathname: /ws
|
|
security:
|
|
- $ref: "#/components/securitySchemes/JwtAuth"
|
|
|
|
channels:
|
|
connection:
|
|
title: Connection
|
|
description: |
|
|
The Base Channel used for:
|
|
- Authentication
|
|
- Receiving Tokens for other channels
|
|
- Reconnection
|
|
messages:
|
|
RequestConnectionToken:
|
|
description: |
|
|
A Message telling the Server, that
|
|
you want an Connection Token for a
|
|
Specific Channel
|
|
payload:
|
|
type: object
|
|
properties:
|
|
$id:
|
|
type: string
|
|
format: messageId
|
|
channel:
|
|
type: string
|
|
enum:
|
|
- time
|
|
required:
|
|
- $id
|
|
- channel
|
|
ProvidedConnectionToken:
|
|
description: |
|
|
A Message telling the Server, that
|
|
you want an Connection Token for a
|
|
Specific Channel
|
|
payload:
|
|
type: object
|
|
properties:
|
|
$id:
|
|
type: string
|
|
format: messageId
|
|
channel:
|
|
type: string
|
|
enum:
|
|
- time
|
|
token:
|
|
$ref: "#/components/schemas/JWT"
|
|
required:
|
|
- $id
|
|
- channel
|
|
- token
|
|
time:
|
|
title: Time
|
|
description: |
|
|
A Simple example channel for receiving
|
|
the current Unix time
|
|
messages:
|
|
CurrentUnixTime:
|
|
description: The Current time in Unix Time
|
|
payload:
|
|
type: object
|
|
properties:
|
|
$id:
|
|
type: string
|
|
format: messageId
|
|
time:
|
|
type: integer
|
|
format: int64
|
|
required:
|
|
- $id
|
|
- time
|
|
|
|
operations:
|
|
requestConnectionToken:
|
|
title: RequestConnectionToken
|
|
action: send
|
|
channel:
|
|
$ref: "#/channels/connection"
|
|
messages:
|
|
- $ref: "#/channels/connection/messages/RequestConnectionToken"
|
|
reply:
|
|
channel:
|
|
$ref: "#/channels/connection"
|
|
messages:
|
|
- $ref: "#/channels/connection/messages/ProvidedConnectionToken"
|
|
updateTime:
|
|
title: Updates of the current Unix Time
|
|
action: receive
|
|
channel:
|
|
$ref: "#/channels/time"
|
|
messages:
|
|
- $ref: "#/channels/time/messages/CurrentUnixTime"
|
|
|
|
components:
|
|
securitySchemes:
|
|
JwtAuth:
|
|
name: Authorization
|
|
description: |
|
|
A JWT Token has to be provided in the Handshake Header. <br>
|
|
This Field is expected to be called `Authorization`. <br>
|
|
It is expected to not have a prefix like `bearer`.
|
|
type: httpApiKey
|
|
in: header
|
|
schemas:
|
|
JWT:
|
|
type: string
|
|
format: jwt
|