feat: POST /api/v3/chats, chat room creation, plus openAPI docs update

This commit is contained in:
Julian Lam
2021-12-13 14:02:02 -05:00
parent 94bead71fe
commit 40b4544e70
9 changed files with 97 additions and 13 deletions

View File

@@ -0,0 +1,14 @@
RoomObject:
type: object
properties:
owner:
type: number
description: the uid of the chat room owner (usually the user who created the room initially)
roomId:
type: string
description: unique identifier for the chat room
roomName:
type: string
groupChat:
type: boolean
description: whether the chat room is a group chat or not

View File

@@ -19,7 +19,7 @@ info:
# Authentication
Please see the ["Authentication" section under the Read API](../read/#section/Overview/Authentication) for more information on how to authenticate against this API in order to make calls.
version: 1.15.0
version: 1.19.0
contact:
email: support@nodebb.org
license:
@@ -39,6 +39,8 @@ tags:
description: Topic-based calls (create, modify, delete, etc.)
- name: posts
description: Individual post-related calls (create, modify, delete, etc.)
- name: chats
description: Calls related to the user private messaging system
- name: admin
description: Administrative calls
- name: files

View File

@@ -0,0 +1,29 @@
post:
tags:
- chats
summary: create a chat room
description: This operation creates a new chat room and adds users to the room, if provided.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
uids:
type: array
example: [2, 3]
required:
- uids
responses:
'200':
description: chat room successfully created
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../components/schemas/Status.yaml#/Status
response:
$ref: ../components/schemas/Chats.yaml#/RoomObject