ActivityPub-federated video streaming platform using P2P directly in your web browser
update openapi spec with links and callback for search
Rigel Kent2c318664305f
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.tsindex c8e9eaeaaf..732a6faa3b 100644--- a/server/controllers/api/users/index.ts+++ b/server/controllers/api/users/index.ts@@ -205,7 +205,7 @@ async function createUser (req: express.Request, res: express.Response) {Hooks.runAction('action:api.user.created', { body, user, account, videoChannel })- return res.json({+ return res.status(201).json({user: {id: user.id,account: {diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yamlindex 6c1ffee4f0..3b06a25684 100644--- a/support/doc/api/openapi.yaml+++ b/support/doc/api/openapi.yaml@@ -484,12 +484,30 @@ paths:tags:- Usersresponses:- '200':- description: successful operation+ '201':+ description: user createdcontent:application/json:schema:$ref: '#/components/schemas/AddUserResponse'+ links:+ # GET /users/{id}+ GetUserId:+ operationId: getUserId+ parameters:+ id: '$response.body#/user/id'+ # PUT /users/{id}+ PutUserId:+ operationId: putUserId+ parameters:+ id: '$response.body#/user/id'+ # DELETE /users/{id}+ DelUserId:+ operationId: delUserId+ parameters:+ id: '$response.body#/user/id'+ '403':+ description: insufficient authority to create an admin or moderatorrequestBody:content:application/json:@@ -517,6 +535,8 @@ paths:items:$ref: '#/components/schemas/User''/users/{id}':+ parameters:+ - $ref: '#/components/parameters/id'delete:summary: Delete a usersecurity:@@ -524,8 +544,7 @@ paths:- admintags:- Users- parameters:- - $ref: '#/components/parameters/id'+ operationId: delUserIdresponses:'204':description: successful operation@@ -535,8 +554,7 @@ paths:- OAuth2: []tags:- Users- parameters:- - $ref: '#/components/parameters/id'+ operationId: getUserIdresponses:'200':description: successful operation@@ -550,8 +568,7 @@ paths:- OAuth2: []tags:- Users- parameters:- - $ref: '#/components/parameters/id'+ operationId: putUserIdresponses:'204':description: successful operation@@ -701,12 +718,28 @@ paths:'200':description: successful operationpost:+ tags:+ - My Subscriptionssummary: Add subscription to my usersecurity:- OAuth2:- user- tags:- - My Subscriptions+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ uri:+ type: string+ format: uri+ description: uri of the video channels to subscribe to+ required:+ - uri+ examples:+ default:+ value:+ uri: [email protected]responses:'200':description: successful operation@@ -816,7 +849,7 @@ paths:- My NotificationsrequestBody:content:- multipart/form-data:+ application/json:schema:type: objectproperties:@@ -849,7 +882,7 @@ paths:- My NotificationsrequestBody:content:- multipart/form-data:+ application/json:schema:type: objectproperties:@@ -1930,6 +1963,9 @@ paths:type: integerrequired:- displayName+ encoding:+ thumbnailfile:+ contentType: image/jpeg/video-playlists/{id}:get:@@ -1978,6 +2014,9 @@ paths:videoChannelId:description: Video channel in which the playlist will be publishedtype: integer+ encoding:+ thumbnailfile:+ contentType: image/jpegdelete:summary: Delete a video playlistsecurity:@@ -2242,6 +2281,8 @@ paths:application/json:schema:$ref: '#/components/schemas/CommentThreadPostResponse'+ '404':+ description: video does not existrequestBody:content:application/json:@@ -2286,6 +2327,8 @@ paths:application/json:schema:$ref: '#/components/schemas/CommentThreadPostResponse'+ '404':+ description: thread or video does not existrequestBody:content:application/json:@@ -2328,6 +2371,8 @@ paths:responses:'204':description: successful operation+ '404':+ description: video does not exist/search/videos:get:tags:@@ -2390,6 +2435,9 @@ paths:description: Get videos that have this maximum durationschema:type: integer+ callbacks:+ 'searchTarget === search-index':+ $ref: '#/components/callbacks/searchIndex'responses:'200':description: successful operation@@ -2397,6 +2445,8 @@ paths:application/json:schema:$ref: '#/components/schemas/VideoListResponse'+ '500':+ description: search index unavailable/search/video-channels:get:tags:@@ -2416,6 +2466,9 @@ paths:- $ref: '#/components/parameters/count'- $ref: '#/components/parameters/searchTarget'- $ref: '#/components/parameters/sort'+ callbacks:+ 'searchTarget === search-index':+ $ref: '#/components/callbacks/searchIndex'responses:'200':description: successful operation@@ -2425,6 +2478,8 @@ paths:type: arrayitems:$ref: '#/components/schemas/VideoChannel'+ '500':+ description: search index unavailable/blocklist/accounts:get:tags:@@ -3455,6 +3510,7 @@ components:- 1- 2description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'+ example: 2VideoStateConstant:properties:@@ -4481,12 +4537,18 @@ components:format: date-timeAddUserResponse:properties:- id:- type: integer- uuid:- type: string- format: uuid- example: 9c9de5e8-0a1e-484a-b099-e80766180a6d+ user:+ type: object+ properties:+ id:+ type: integer+ example: 8+ account:+ type: object+ properties:+ id:+ type: integer+ example: 37VideoUploadResponse:properties:video:@@ -5156,4 +5218,16 @@ components:type: arraymaxItems: 100items:- $ref: '#/components/schemas/Plugin'\ No newline at end of file+ $ref: '#/components/schemas/Plugin'+ callbacks:+ searchIndex:+ '{%CONFIG.SEARCH.SEARCH_INDEX.URL%}/api/v1/search/videos/':+ post:+ summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`+ responses:+ '200':+ description: successful operation+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/VideoListResponse'\ No newline at end of file