-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missed fields in chat schema & update examples in Swagger docs #1068
base: develop
Are you sure you want to change the base?
Conversation
Quality Gate passedIssues Measures |
@@ -10,7 +10,7 @@ definitions: | |||
type: object | |||
properties: | |||
user: | |||
type: string | |||
type: object | |||
$ref: '#/components/user' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ref: '#/components/user' | |
$ref: '#/definitions/user' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties: | ||
user: | ||
type: object | ||
$ref: '#/components/user' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ref: '#/components/user' | |
$ref: '#/definitions/user' |
@@ -36,7 +47,7 @@ definitions: | |||
type: object | |||
properties: | |||
user: | |||
type: string | |||
type: object | |||
ref: '#/components/user' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref: '#/components/user' | |
ref: '#/definitions/user' |
@@ -10,7 +10,7 @@ definitions: | |||
type: object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Members
is not an object, its an array, check src\models\chat.js
type: object | ||
properties: | ||
user: | ||
type: object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably its just a string, check real API, please
properties: | ||
user: | ||
type: object | ||
$ref: '#/components/user' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ref: '#/components/user' | |
$ref: '#/definitions/user' |
type: object | ||
properties: | ||
user: | ||
type: object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, check the chat service, probably there are only ids, so it would be a string
type: object | ||
$ref: '#/components/user' | ||
latestMessage: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're assigning an object to a string, it's not correct
- user: | ||
_id: 67519181170a70623366d30c | ||
firstName: Diana | ||
lastName: Test | ||
role: tutor | ||
- user: 6421d9833cdf38b706756dff | ||
- user: | ||
_id: 673f342709e56a9071f5308c | ||
firstName: valya | ||
lastName: dudchak | ||
professionalSummary: "" | ||
photo: 1733337385040-photofordemo.jpg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why user have different fields in each example?
- user: | ||
_id: 67519181170a70623366d30c | ||
firstName: Diana | ||
lastName: Test | ||
role: tutor | ||
createdAt: 2024-08-01T13:25:36.292Z | ||
updatedAt: 2024-08-01T13:25:36.292Z | ||
- user: | ||
_id: 6735ff2cc8f5e44cc3de002d | ||
firstName: Pavlo | ||
lastName: Butynets | ||
role: student |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: Improved the
Chat
schema documentation in Swagger by adding missing fields, fixing existing issues, and updating examples to align with the API's actual behavior.Added missing fields:
deletedFor
- an array of users for whom the chat is marked as deleted;latestMessage
- a reference to the most recent message in the chat.Updated examples for chats:
/chats
, 200 response - getting all chats for a current user;/chats/{id}
, 200 response - marking a chat as deleted for the current user.Additionally: changed the type of
user
field to object, a reference to a user component.Corrected chat examples: