diff --git a/openapi/components/paths/invite.yaml b/openapi/components/paths/invite.yaml index afce0e57..140c486e 100644 --- a/openapi/components/paths/invite.yaml +++ b/openapi/components/paths/invite.yaml @@ -102,6 +102,12 @@ paths: - apiKeyCookie: [] authCookie: [] description: Sends an invite to a user. Returns the Notification of type `invite` that was sent. + requestBody: + content: + application/json: + schema: + $ref: ../requests/InviteRequest.yaml + description: Instance ID when inviting a user. '/invite/{notificationId}/response': parameters: - $ref: ../parameters.yaml#/notificationId @@ -119,6 +125,12 @@ paths: - apiKeyCookie: [] authCookie: [] description: Sends a world invite to a user. + requestBody: + content: + application/json: + schema: + $ref: ../requests/InviteResponse.yaml + description: Instance ID when inviting a user. '/requestInvite/{userId}': parameters: - $ref: ../parameters.yaml#/userId diff --git a/openapi/components/requests/InviteRequest.yaml b/openapi/components/requests/InviteRequest.yaml new file mode 100644 index 00000000..5075d403 --- /dev/null +++ b/openapi/components/requests/InviteRequest.yaml @@ -0,0 +1,7 @@ +title: InviteRequest +type: object +properties: + instanceId: + $ref: ../schemas/InstanceID.yaml +required: + - instanceId \ No newline at end of file diff --git a/openapi/components/requests/InviteResponse.yaml b/openapi/components/requests/InviteResponse.yaml new file mode 100644 index 00000000..cc8247a8 --- /dev/null +++ b/openapi/components/requests/InviteResponse.yaml @@ -0,0 +1,9 @@ +type: object +properties: + responseSlot: + type: integer + minimum: 0 + maximum: 11 +required: + - responseSlot +title: InviteResponse diff --git a/openapi/components/schemas/Instance.yaml b/openapi/components/schemas/Instance.yaml index c8a2367e..1867f291 100644 --- a/openapi/components/schemas/Instance.yaml +++ b/openapi/components/schemas/Instance.yaml @@ -19,8 +19,7 @@ properties: type: boolean default: false id: - type: string - minLength: 1 + $ref: ./InstanceID.yaml instanceId: type: string minLength: 1 diff --git a/openapi/components/schemas/InstanceID.yaml b/openapi/components/schemas/InstanceID.yaml new file mode 100644 index 00000000..904106e2 --- /dev/null +++ b/openapi/components/schemas/InstanceID.yaml @@ -0,0 +1,4 @@ +title: InstanceID +type: string +pattern: '(wrld|wld)_[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}:(\d+)(~region\(([\w]+)\))?(~([\w]+)\(usr_([\w-]+)\)((\~canRequestInvite)?)(~region\(([\w].+)\))?~nonce\((.+)\))?' +example: wrld_ba913a96-fac4-4048-a062-9aa5db092812:123456 \ No newline at end of file diff --git a/openapi/components/schemas/InviteMessage.yaml b/openapi/components/schemas/InviteMessage.yaml index c7178b7e..09e9a6b5 100644 --- a/openapi/components/schemas/InviteMessage.yaml +++ b/openapi/components/schemas/InviteMessage.yaml @@ -7,6 +7,7 @@ properties: slot: type: integer minimum: 0 + maximum: 11 message: type: string minLength: 1