openapi: Update error responses and schemas for consistency
This commit is contained in:
parent
5a66b2f623
commit
67ff3e2494
@ -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
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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"'
|
||||||
@ -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"'
|
||||||
|
|||||||
@ -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"'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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:
|
||||||
|
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'
|
message: 'Recording "room-123--EG_XYZ--XX445" is already stopped'
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -4,4 +4,5 @@ content:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '../schemas/error.yaml'
|
$ref: '../schemas/error.yaml'
|
||||||
example:
|
example:
|
||||||
|
error: Authentication Error
|
||||||
message: 'Unauthorized'
|
message: 'Unauthorized'
|
||||||
|
|||||||
@ -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}}'
|
||||||
|
|||||||
@ -1,11 +1,21 @@
|
|||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
|
- error
|
||||||
- message
|
- message
|
||||||
properties:
|
properties:
|
||||||
name:
|
error:
|
||||||
|
type: string
|
||||||
|
description: Name of the error
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
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
|
type: string
|
||||||
message:
|
message:
|
||||||
type: string
|
type: string
|
||||||
code:
|
|
||||||
type: integer
|
|
||||||
description: HTTP status code associated with the error
|
|
||||||
|
|||||||
@ -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:
|
||||||
|
|||||||
@ -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}}'
|
|
||||||
@ -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'
|
||||||
|
|||||||
@ -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 => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user