openapi: Update error responses and schemas for consistency

This commit is contained in:
juancarmore 2025-04-30 17:16:17 +02:00
parent 5a66b2f623
commit 67ff3e2494
25 changed files with 60 additions and 50 deletions

View File

@ -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

View File

@ -3,4 +3,4 @@ required: true
content:
application/json:
schema:
$ref: '../../schemas/internal/meet-token-options.yaml'
$ref: '../../schemas/internal/meet-participant-options.yaml'

View File

@ -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'

View File

@ -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'

View File

@ -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'

View File

@ -4,4 +4,5 @@ content:
schema:
$ref: '../schemas/error.yaml'
example:
error: Authorization Error
message: 'Insufficient permissions to access this resource'

View File

@ -4,4 +4,5 @@ content:
schema:
$ref: '../schemas/error.yaml'
example:
message: 'Internal server error'
error: 'Internal Server Error'
message: 'Unexpected error occurred'

View File

@ -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'

View File

@ -4,4 +4,5 @@ content:
schema:
$ref: ../../schemas/error.yaml
example:
error: Refresh Token Error
message: 'No refresh token provided'

View File

@ -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"'
error: 'Room Error'
message: 'Secret "123456" is not recognized for room "room-123"'

View File

@ -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"'

View File

@ -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"'

View File

@ -4,4 +4,5 @@ content:
schema:
$ref: '../../schemas/error.yaml'
example:
error: Participant Error
message: 'Participant token is still valid'

View File

@ -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'

View File

@ -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'

View File

@ -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

View File

@ -4,4 +4,5 @@ content:
schema:
$ref: '../schemas/error.yaml'
example:
error: Authentication Error
message: 'Unauthorized'

View File

@ -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}}'

View File

@ -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

View File

@ -10,7 +10,6 @@ MeetRoomPreferences:
virtualBackgroundPreferences:
$ref: '#/MeetVirtualBackgroundPreferences'
description: Preferences for virtual background in the room.
MeetChatPreferences:
type: object
properties:

View File

@ -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}}'

View File

@ -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'

View File

@ -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 => {