From 1071c4c97ea1c84c38bfb47ae3e1ace174060bd4 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Wed, 13 Aug 2025 17:13:32 +0200 Subject: [PATCH] openapi: replace participantName with participantIdentity in API parameters and improve updateParticipant endpoint --- .../internal/participant-identity.yaml | 7 ++ .../parameters/internal/participant-name.yaml | 7 -- .../internal/update-participant-request.yaml | 12 +++ .../internal/success-update-participant.yaml | 2 +- .../openapi/openvidu-meet-internal-api.yaml | 4 +- backend/openapi/paths/internal/meetings.yaml | 73 ++++++++----------- 6 files changed, 54 insertions(+), 51 deletions(-) create mode 100644 backend/openapi/components/parameters/internal/participant-identity.yaml delete mode 100644 backend/openapi/components/parameters/internal/participant-name.yaml create mode 100644 backend/openapi/components/requestBodies/internal/update-participant-request.yaml diff --git a/backend/openapi/components/parameters/internal/participant-identity.yaml b/backend/openapi/components/parameters/internal/participant-identity.yaml new file mode 100644 index 0000000..b10b346 --- /dev/null +++ b/backend/openapi/components/parameters/internal/participant-identity.yaml @@ -0,0 +1,7 @@ +name: participantIdentity +in: path +required: true +description: The identity of the participant. +schema: + type: string +example: 'Alice' diff --git a/backend/openapi/components/parameters/internal/participant-name.yaml b/backend/openapi/components/parameters/internal/participant-name.yaml deleted file mode 100644 index 328867b..0000000 --- a/backend/openapi/components/parameters/internal/participant-name.yaml +++ /dev/null @@ -1,7 +0,0 @@ -name: participantName -in: path -required: true -description: The name of the participant. -schema: - type: string -example: 'Alice' diff --git a/backend/openapi/components/requestBodies/internal/update-participant-request.yaml b/backend/openapi/components/requestBodies/internal/update-participant-request.yaml new file mode 100644 index 0000000..a11552f --- /dev/null +++ b/backend/openapi/components/requestBodies/internal/update-participant-request.yaml @@ -0,0 +1,12 @@ +description: Update participant role +required: true +content: + application/json: + schema: + type: object + properties: + role: + type: string + enum: ['moderator', 'speaker'] + description: The new role to assign to the participant. + example: 'moderator' diff --git a/backend/openapi/components/responses/internal/success-update-participant.yaml b/backend/openapi/components/responses/internal/success-update-participant.yaml index 848401c..68374b1 100644 --- a/backend/openapi/components/responses/internal/success-update-participant.yaml +++ b/backend/openapi/components/responses/internal/success-update-participant.yaml @@ -6,4 +6,4 @@ content: properties: message: type: string - example: 'Participant "123" role updated to "moderator"' + example: 'Participant "Alice" role updated to "moderator"' diff --git a/backend/openapi/openvidu-meet-internal-api.yaml b/backend/openapi/openvidu-meet-internal-api.yaml index f23e24b..7682b92 100644 --- a/backend/openapi/openvidu-meet-internal-api.yaml +++ b/backend/openapi/openvidu-meet-internal-api.yaml @@ -46,8 +46,8 @@ paths: $ref: './paths/internal/participants.yaml#/~1participants~1token~1refresh' /meetings/{roomId}: $ref: './paths/internal/meetings.yaml#/~1meetings~1{roomId}' - /meetings/{roomId}/participants/{participantName}: - $ref: './paths/internal/meetings.yaml#/~1meetings~1{roomId}~1participants~1{participantName}' + /meetings/{roomId}/participants/{participantIdentity}: + $ref: './paths/internal/meetings.yaml#/~1meetings~1{roomId}~1participants~1{participantIdentity}' components: securitySchemes: diff --git a/backend/openapi/paths/internal/meetings.yaml b/backend/openapi/paths/internal/meetings.yaml index bddff22..4a50496 100644 --- a/backend/openapi/paths/internal/meetings.yaml +++ b/backend/openapi/paths/internal/meetings.yaml @@ -26,9 +26,38 @@ $ref: '../../components/responses/error-room-not-found.yaml' '500': $ref: '../../components/responses/internal-server-error.yaml' -/meetings/{roomId}/participants/{participantName}: +/meetings/{roomId}/participants/{participantIdentity}: + patch: + operationId: updateParticipant + summary: Update participant in a meeting + description: > + Updates the properties of a participant in the current meeting in an OpenVidu Meet room. + This can be used to change the participant role. + tags: + - Internal API - Meetings + security: + - participantTokenCookie: [] + parameters: + - $ref: '../../components/parameters/room-id-path.yaml' + - $ref: '../../components/parameters/internal/participant-identity.yaml' + - $ref: '../../components/parameters/internal/x-participant-role.yaml' + requestBody: + $ref: '../../components/requestBodies/internal/update-participant-request.yaml' + responses: + '200': + $ref: '../../components/responses/internal/success-update-participant.yaml' + '400': + $ref: '../../components/responses/internal/error-invalid-participant-role.yaml' + '401': + $ref: '../../components/responses/unauthorized-error.yaml' + '403': + $ref: '../../components/responses/forbidden-error.yaml' + '404': + $ref: '../../components/responses/internal/error-room-participant-not-found.yaml' + '500': + $ref: '../../components/responses/internal-server-error.yaml' delete: - operationId: disconnectParticipant + operationId: kickParticipant summary: Kick a participant from a meeting description: > Kicks a participant from the current meeting in an OpenVidu Meet room. @@ -38,7 +67,7 @@ - participantTokenCookie: [] parameters: - $ref: '../../components/parameters/room-id-path.yaml' - - $ref: '../../components/parameters/internal/participant-name.yaml' + - $ref: '../../components/parameters/internal/participant-identity.yaml' - $ref: '../../components/parameters/internal/x-participant-role.yaml' responses: '200': @@ -53,42 +82,4 @@ $ref: '../../components/responses/internal/error-room-participant-not-found.yaml' '500': $ref: '../../components/responses/internal-server-error.yaml' - patch: - operationId: updateParticipant - summary: Update participant in a meeting - description: > - Updates the properties of a participant in the current meeting in an OpenVidu Meet room. - This can be used to change the participant role. - tags: - - Internal API - Meetings - security: - - participantTokenCookie: [] - parameters: - - $ref: '../../components/parameters/room-id-path.yaml' - - $ref: '../../components/parameters/internal/participant-name.yaml' - # - $ref: '../../components/parameters/internal/x-participant-role.yaml' - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - role: - type: string - enum: [MODERATOR, SPEAKER] - description: The new role for the participant. - responses: - '200': - $ref: '../../components/responses/internal/success-update-participant.yaml' - '400': - $ref: '../../components/responses/internal/error-invalid-participant-role.yaml' - '401': - $ref: '../../components/responses/unauthorized-error.yaml' - '403': - $ref: '../../components/responses/forbidden-error.yaml' - '404': - $ref: '../../components/responses/internal/error-room-participant-not-found.yaml' - '500': - $ref: '../../components/responses/internal-server-error.yaml'