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 name: nextPageToken
in: query in: query
required: false required: false
description: The token to retrieve the next page of rooms. description: The token to retrieve the next page of elements.
schema: schema:
type: string type: string

View File

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

View File

@ -4,5 +4,5 @@ content:
schema: schema:
$ref: '../schemas/error.yaml' $ref: '../schemas/error.yaml'
example: example:
name: 'Recording Error' error: 'Recording Error'
message: 'Recording "room-123--EG_XYZ--XX445" is in progress' message: 'Recording "room-123--EG_XYZ--XX445" is not stopped yet'

View File

@ -4,5 +4,5 @@ content:
schema: schema:
$ref: '../schemas/error.yaml' $ref: '../schemas/error.yaml'
example: example:
name: 'Recording Error' error: 'Recording Error'
message: 'Recording "room-123--EG_XYZ--XX445" not found' message: 'Recording "room-123--EG_XYZ--XX445" not found'

View File

@ -4,5 +4,5 @@ content:
schema: schema:
$ref: '../schemas/error.yaml' $ref: '../schemas/error.yaml'
example: example:
name: 'Room Error' error: 'Room Error'
message: 'The room "room_123" does not exist' message: 'Room "room_123" does not exist'

View File

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

View File

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

View File

@ -4,4 +4,5 @@ content:
schema: schema:
$ref: ../../schemas/error.yaml $ref: ../../schemas/error.yaml
example: example:
message: 'Login failed. Invalid username or password' error: Login Error
message: 'Invalid username or password'

View File

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

View File

@ -4,5 +4,5 @@ content:
schema: schema:
$ref: ../../schemas/error.yaml $ref: ../../schemas/error.yaml
example: example:
name: 'Room Error' error: 'Room Error'
message: 'The secret "123456"" is not recognized for room "room-123"' message: 'Secret "123456" is not recognized for room "room-123"'

View File

@ -4,5 +4,5 @@ content:
schema: schema:
$ref: '../../schemas/error.yaml' $ref: '../../schemas/error.yaml'
example: example:
name: 'Participant Error' error: 'Participant Error'
message: '"Alice" already exists in the room "room_123"' message: 'Participant "Alice" already exists in room "room_123"'

View File

@ -4,5 +4,5 @@ content:
schema: schema:
$ref: '../../schemas/error.yaml' $ref: '../../schemas/error.yaml'
example: example:
name: 'Participant Error' error: 'Participant Error'
message: '"Alice" not found in room "room_123"' message: 'Participant "Alice" not found in room "room_123"'

View File

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

View File

@ -7,10 +7,10 @@ content:
already_recording: already_recording:
summary: Room is already being recorded summary: Room is already being recorded
value: value:
name: 'Recording Error' error: 'Recording Error'
message: 'The room "room-123" is already being recorded' message: 'Room "room-123" is already being recorded'
no_participants: no_participants:
summary: Room has no participants summary: Room has no participants
value: value:
name: 'Recording Error' error: 'Recording Error'
message: 'The room "room-123" has no participants' message: 'Room "room-123" has no participants'

View File

@ -3,6 +3,14 @@ content:
application/json: application/json:
schema: schema:
$ref: '../../schemas/error.yaml' $ref: '../../schemas/error.yaml'
example: examples:
name: 'Recording Error' starting_recording:
message: 'Recording "room-123--EG_XYZ--XX445" is already stopped' 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: starting_timeout:
summary: Recording service timed out summary: Recording service timed out
value: value:
name: 'Recording Error' error: 'Recording Error'
message: Recording in room 'room-123' timed out while starting message: Recording in room 'room-123' timed out while starting

View File

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

View File

@ -2,4 +2,10 @@ description: Unprocessable Entity — Invalid request body
content: content:
application/json: application/json:
schema: 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 type: object
required: required:
- error
- message - message
properties: properties:
name: error:
type: string type: string
description: Name of the error
message: message:
type: string type: string
code: description: Description of the error
type: integer details:
description: HTTP status code associated with the error 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: virtualBackgroundPreferences:
$ref: '#/MeetVirtualBackgroundPreferences' $ref: '#/MeetVirtualBackgroundPreferences'
description: Preferences for virtual background in the room. description: Preferences for virtual background in the room.
MeetChatPreferences: MeetChatPreferences:
type: object type: object
properties: 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: security:
- participantTokenCookie: [] - participantTokenCookie: []
requestBody: requestBody:
$ref: '../../components/requestBodies/start-recording-request.yaml' $ref: '../../components/requestBodies/internal/start-recording-request.yaml'
responses: responses:
'201': '201':
$ref: '../../components/responses/internal/success-start-recording.yaml' $ref: '../../components/responses/internal/success-start-recording.yaml'

View File

@ -85,7 +85,7 @@ export const errorInvalidRefreshToken = (): OpenViduMeetError => {
}; };
export const errorInsufficientPermissions = (): 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 => { export const errorInvalidApiKey = (): OpenViduMeetError => {