diff --git a/backend/openapi/components/parameters/next-page-token.yaml b/backend/openapi/components/parameters/next-page-token.yaml index 5c86f32..18a096c 100644 --- a/backend/openapi/components/parameters/next-page-token.yaml +++ b/backend/openapi/components/parameters/next-page-token.yaml @@ -1,6 +1,6 @@ name: nextPageToken in: query required: false -description: The token to retrieve the next page of rooms. +description: The token to retrieve the next page of elements. schema: type: string diff --git a/backend/openapi/components/requestBodies/internal/participant-token-request.yaml b/backend/openapi/components/requestBodies/internal/participant-token-request.yaml index cbdb434..cbbcf79 100644 --- a/backend/openapi/components/requestBodies/internal/participant-token-request.yaml +++ b/backend/openapi/components/requestBodies/internal/participant-token-request.yaml @@ -3,4 +3,4 @@ required: true content: application/json: schema: - $ref: '../../schemas/internal/meet-token-options.yaml' + $ref: '../../schemas/internal/meet-participant-options.yaml' diff --git a/backend/openapi/components/requestBodies/start-recording-request.yaml b/backend/openapi/components/requestBodies/internal/start-recording-request.yaml similarity index 100% rename from backend/openapi/components/requestBodies/start-recording-request.yaml rename to backend/openapi/components/requestBodies/internal/start-recording-request.yaml diff --git a/backend/openapi/components/responses/error-recording-in-progress.yaml b/backend/openapi/components/responses/error-recording-in-progress.yaml index 979cd8a..7bcec77 100644 --- a/backend/openapi/components/responses/error-recording-in-progress.yaml +++ b/backend/openapi/components/responses/error-recording-in-progress.yaml @@ -4,5 +4,5 @@ content: schema: $ref: '../schemas/error.yaml' example: - name: 'Recording Error' - message: 'Recording "room-123--EG_XYZ--XX445" is in progress' + error: 'Recording Error' + message: 'Recording "room-123--EG_XYZ--XX445" is not stopped yet' diff --git a/backend/openapi/components/responses/error-recording-not-found.yaml b/backend/openapi/components/responses/error-recording-not-found.yaml index 59c5c67..1c22772 100644 --- a/backend/openapi/components/responses/error-recording-not-found.yaml +++ b/backend/openapi/components/responses/error-recording-not-found.yaml @@ -4,5 +4,5 @@ content: schema: $ref: '../schemas/error.yaml' example: - name: 'Recording Error' + error: 'Recording Error' message: 'Recording "room-123--EG_XYZ--XX445" not found' diff --git a/backend/openapi/components/responses/error-room-not-found.yaml b/backend/openapi/components/responses/error-room-not-found.yaml index 6265d1a..c688b8a 100644 --- a/backend/openapi/components/responses/error-room-not-found.yaml +++ b/backend/openapi/components/responses/error-room-not-found.yaml @@ -4,5 +4,5 @@ content: schema: $ref: '../schemas/error.yaml' example: - name: 'Room Error' - message: 'The room "room_123" does not exist' + error: 'Room Error' + message: 'Room "room_123" does not exist' diff --git a/backend/openapi/components/responses/forbidden-error.yaml b/backend/openapi/components/responses/forbidden-error.yaml index 9b3a5a9..78cdf1c 100644 --- a/backend/openapi/components/responses/forbidden-error.yaml +++ b/backend/openapi/components/responses/forbidden-error.yaml @@ -4,4 +4,5 @@ content: schema: $ref: '../schemas/error.yaml' example: + error: Authorization Error message: 'Insufficient permissions to access this resource' diff --git a/backend/openapi/components/responses/internal-server-error.yaml b/backend/openapi/components/responses/internal-server-error.yaml index 1ecc014..60a66a7 100644 --- a/backend/openapi/components/responses/internal-server-error.yaml +++ b/backend/openapi/components/responses/internal-server-error.yaml @@ -4,4 +4,5 @@ content: schema: $ref: '../schemas/error.yaml' example: - message: 'Internal server error' + error: 'Internal Server Error' + message: 'Unexpected error occurred' diff --git a/backend/openapi/components/responses/internal/error-invalid-credentials.yaml b/backend/openapi/components/responses/internal/error-invalid-credentials.yaml index 72eace1..de36544 100644 --- a/backend/openapi/components/responses/internal/error-invalid-credentials.yaml +++ b/backend/openapi/components/responses/internal/error-invalid-credentials.yaml @@ -4,4 +4,5 @@ content: schema: $ref: ../../schemas/error.yaml example: - message: 'Login failed. Invalid username or password' + error: Login Error + message: 'Invalid username or password' diff --git a/backend/openapi/components/responses/internal/error-invalid-refresh-token.yaml b/backend/openapi/components/responses/internal/error-invalid-refresh-token.yaml index b96e791..5cb1db7 100644 --- a/backend/openapi/components/responses/internal/error-invalid-refresh-token.yaml +++ b/backend/openapi/components/responses/internal/error-invalid-refresh-token.yaml @@ -4,4 +4,5 @@ content: schema: $ref: ../../schemas/error.yaml example: + error: Refresh Token Error message: 'No refresh token provided' diff --git a/backend/openapi/components/responses/internal/error-invalid-room-secret.yaml b/backend/openapi/components/responses/internal/error-invalid-room-secret.yaml index 7934e9f..2d6ea92 100644 --- a/backend/openapi/components/responses/internal/error-invalid-room-secret.yaml +++ b/backend/openapi/components/responses/internal/error-invalid-room-secret.yaml @@ -4,5 +4,5 @@ content: schema: $ref: ../../schemas/error.yaml example: - name: 'Room Error' - message: 'The secret "123456"" is not recognized for room "room-123"' \ No newline at end of file + error: 'Room Error' + message: 'Secret "123456" is not recognized for room "room-123"' \ No newline at end of file diff --git a/backend/openapi/components/responses/internal/error-participant-already-exists.yaml b/backend/openapi/components/responses/internal/error-participant-already-exists.yaml index 21f0155..e8559ab 100644 --- a/backend/openapi/components/responses/internal/error-participant-already-exists.yaml +++ b/backend/openapi/components/responses/internal/error-participant-already-exists.yaml @@ -4,5 +4,5 @@ content: schema: $ref: '../../schemas/error.yaml' example: - name: 'Participant Error' - message: '"Alice" already exists in the room "room_123"' + error: 'Participant Error' + message: 'Participant "Alice" already exists in room "room_123"' diff --git a/backend/openapi/components/responses/internal/error-participant-not-found.yaml b/backend/openapi/components/responses/internal/error-participant-not-found.yaml index 45809d1..8f7a861 100644 --- a/backend/openapi/components/responses/internal/error-participant-not-found.yaml +++ b/backend/openapi/components/responses/internal/error-participant-not-found.yaml @@ -4,5 +4,5 @@ content: schema: $ref: '../../schemas/error.yaml' example: - name: 'Participant Error' - message: '"Alice" not found in room "room_123"' + error: 'Participant Error' + message: 'Participant "Alice" not found in room "room_123"' diff --git a/backend/openapi/components/responses/internal/error-participant-token-still-valid.yaml b/backend/openapi/components/responses/internal/error-participant-token-still-valid.yaml index 71c941e..20f17dc 100644 --- a/backend/openapi/components/responses/internal/error-participant-token-still-valid.yaml +++ b/backend/openapi/components/responses/internal/error-participant-token-still-valid.yaml @@ -4,4 +4,5 @@ content: schema: $ref: '../../schemas/error.yaml' example: + error: Participant Error message: 'Participant token is still valid' diff --git a/backend/openapi/components/responses/internal/error-recording-conflict.yaml b/backend/openapi/components/responses/internal/error-recording-conflict.yaml index 5daa49c..1afe2ae 100644 --- a/backend/openapi/components/responses/internal/error-recording-conflict.yaml +++ b/backend/openapi/components/responses/internal/error-recording-conflict.yaml @@ -7,10 +7,10 @@ content: already_recording: summary: Room is already being recorded value: - name: 'Recording Error' - message: 'The room "room-123" is already being recorded' + error: 'Recording Error' + message: 'Room "room-123" is already being recorded' no_participants: summary: Room has no participants value: - name: 'Recording Error' - message: 'The room "room-123" has no participants' + error: 'Recording Error' + message: 'Room "room-123" has no participants' diff --git a/backend/openapi/components/responses/internal/error-recording-not-active.yaml b/backend/openapi/components/responses/internal/error-recording-not-active.yaml index 8416c69..8401898 100644 --- a/backend/openapi/components/responses/internal/error-recording-not-active.yaml +++ b/backend/openapi/components/responses/internal/error-recording-not-active.yaml @@ -3,6 +3,14 @@ content: application/json: schema: $ref: '../../schemas/error.yaml' - example: - name: 'Recording Error' - message: 'Recording "room-123--EG_XYZ--XX445" is already stopped' + examples: + starting_recording: + summary: Recording is starting + value: + error: 'Recording Error' + message: 'Recording "room-123--EG_XYZ--XX445" cannot be stopped while starting' + already_stopped: + summary: Recording is already stopped + value: + error: 'Recording Error' + message: 'Recording "room-123--EG_XYZ--XX445" is already stopped' diff --git a/backend/openapi/components/responses/internal/error-service-unavailable.yaml b/backend/openapi/components/responses/internal/error-service-unavailable.yaml index b662579..0520647 100644 --- a/backend/openapi/components/responses/internal/error-service-unavailable.yaml +++ b/backend/openapi/components/responses/internal/error-service-unavailable.yaml @@ -7,5 +7,5 @@ content: starting_timeout: summary: Recording service timed out value: - name: 'Recording Error' + error: 'Recording Error' message: Recording in room 'room-123' timed out while starting diff --git a/backend/openapi/components/responses/unauthorized-error.yaml b/backend/openapi/components/responses/unauthorized-error.yaml index fa6da95..4a81ccb 100644 --- a/backend/openapi/components/responses/unauthorized-error.yaml +++ b/backend/openapi/components/responses/unauthorized-error.yaml @@ -4,4 +4,5 @@ content: schema: $ref: '../schemas/error.yaml' example: + error: Authentication Error message: 'Unauthorized' diff --git a/backend/openapi/components/responses/validation-error.yaml b/backend/openapi/components/responses/validation-error.yaml index f8a48e7..2ffee30 100644 --- a/backend/openapi/components/responses/validation-error.yaml +++ b/backend/openapi/components/responses/validation-error.yaml @@ -2,4 +2,10 @@ description: Unprocessable Entity — Invalid request body content: application/json: schema: - $ref: '../schemas/validation-error.yaml' + $ref: '../schemas/error.yaml' + example: + error: 'Unprocessable Entity' + message: 'Invalid request' + details: + - field: '{{field}}' + message: 'Expected {{type}} but got {{value}}' diff --git a/backend/openapi/components/schemas/error.yaml b/backend/openapi/components/schemas/error.yaml index 553da84..7663088 100644 --- a/backend/openapi/components/schemas/error.yaml +++ b/backend/openapi/components/schemas/error.yaml @@ -1,11 +1,21 @@ type: object required: + - error - message properties: - name: + error: type: string + description: Name of the error message: type: string - code: - type: integer - description: HTTP status code associated with the error + description: Description of the error + details: + description: List of validation errors in case of '422 Unprocessable Entity' error + type: array + items: + type: object + properties: + field: + type: string + message: + type: string diff --git a/backend/openapi/components/schemas/internal/meet-token-options.yaml b/backend/openapi/components/schemas/internal/meet-participant-options.yaml similarity index 100% rename from backend/openapi/components/schemas/internal/meet-token-options.yaml rename to backend/openapi/components/schemas/internal/meet-participant-options.yaml diff --git a/backend/openapi/components/schemas/meet-room-preferences.yaml b/backend/openapi/components/schemas/meet-room-preferences.yaml index cc7d968..3dfd803 100644 --- a/backend/openapi/components/schemas/meet-room-preferences.yaml +++ b/backend/openapi/components/schemas/meet-room-preferences.yaml @@ -10,7 +10,6 @@ MeetRoomPreferences: virtualBackgroundPreferences: $ref: '#/MeetVirtualBackgroundPreferences' description: Preferences for virtual background in the room. - MeetChatPreferences: type: object properties: diff --git a/backend/openapi/components/schemas/validation-error.yaml b/backend/openapi/components/schemas/validation-error.yaml deleted file mode 100644 index cd90d6f..0000000 --- a/backend/openapi/components/schemas/validation-error.yaml +++ /dev/null @@ -1,19 +0,0 @@ -type: object -properties: - error: - type: string - example: 'Unprocessable Entity' - message: - type: string - example: 'Invalid request' - details: - type: array - items: - type: object - properties: - field: - type: string - example: '{{field}}' - message: - type: string - example: 'Expected {{type}} but got {{value}}' diff --git a/backend/openapi/paths/internal/recordings.yaml b/backend/openapi/paths/internal/recordings.yaml index 435ade9..fa62849 100644 --- a/backend/openapi/paths/internal/recordings.yaml +++ b/backend/openapi/paths/internal/recordings.yaml @@ -9,7 +9,7 @@ security: - participantTokenCookie: [] requestBody: - $ref: '../../components/requestBodies/start-recording-request.yaml' + $ref: '../../components/requestBodies/internal/start-recording-request.yaml' responses: '201': $ref: '../../components/responses/internal/success-start-recording.yaml' diff --git a/backend/src/models/error.model.ts b/backend/src/models/error.model.ts index 7446463..d580c68 100644 --- a/backend/src/models/error.model.ts +++ b/backend/src/models/error.model.ts @@ -85,7 +85,7 @@ export const errorInvalidRefreshToken = (): OpenViduMeetError => { }; export const errorInsufficientPermissions = (): OpenViduMeetError => { - return new OpenViduMeetError('Authorization Error', 'You do not have permission to access this resource', 403); + return new OpenViduMeetError('Authorization Error', 'Insufficient permissions to access this resource', 403); }; export const errorInvalidApiKey = (): OpenViduMeetError => {