-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
role: | ||||||
type: string | ||||||
|
@@ -20,6 +20,17 @@ definitions: | |||||
updatedAt: | ||||||
type: string | ||||||
format: date-time | ||||||
deletedFor: | ||||||
type: array | ||||||
items: | ||||||
type: object | ||||||
properties: | ||||||
user: | ||||||
type: object | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably its just a string, check real API, please |
||||||
$ref: '#/components/user' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
latestMessage: | ||||||
type: string | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its not a string, its an object. Check population in getChats method in |
||||||
$ref: '#/definitions/message' | ||||||
chatBody: | ||||||
type: object | ||||||
properties: | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
role: | ||||||
type: string | ||||||
|
@@ -46,3 +57,14 @@ definitions: | |||||
updatedAt: | ||||||
type: string | ||||||
format: date-time | ||||||
deletedFor: | ||||||
type: array | ||||||
items: | ||||||
type: object | ||||||
properties: | ||||||
user: | ||||||
type: object | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||
$ref: '#/components/user' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
latestMessage: | ||||||
type: string | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're assigning an object to a string, it's not correct |
||||||
$ref: '#/definitions/message' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,22 +62,62 @@ paths: | |
schema: | ||
$ref: '#/definitions/chat' | ||
example: | ||
- _id: 64a54c6c7bca605aaf2da66c | ||
- _id: 67604def753afa7bbd3bd98a | ||
members: | ||
- user: 6491d003a634c3c427b69daa | ||
- user: | ||
_id: 67519181170a70623366d30c | ||
firstName: Diana | ||
lastName: Test | ||
role: tutor | ||
- user: 6421d9833cdf38b706756dff | ||
- user: | ||
_id: 673f342709e56a9071f5308c | ||
firstName: valya | ||
lastName: dudchak | ||
professionalSummary: "" | ||
photo: 1733337385040-photofordemo.jpg | ||
Comment on lines
+67
to
+77
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why user have different fields in each example? |
||
role: student | ||
createdAt: 2024-08-01T13:25:36.292Z | ||
updatedAt: 2024-08-01T13:25:36.292Z | ||
- _id: 64a54c6c7bca605aaf2da6df | ||
createdAt: 2024-12-16T15:57:35.632Z | ||
updatedAt: 2024-12-16T15:57:35.949Z | ||
deletedFor: [] | ||
latestMessage: | ||
_id: 67604def753afa7bbd3bd98c | ||
author: | ||
_id: 67519181170a70623366d30c | ||
firstName: Diana | ||
lastName: Test | ||
authorRole: tutor | ||
text: hi test message | ||
chat: 67604def753afa7bbd3bd98a | ||
clearedFor: [] | ||
createdAt: 2024-12-16T15:57:35.862Z | ||
updatedAt: 2024-12-16T15:57:35.862Z | ||
- _id: 67604eca753afa7bbd3bd9c1 | ||
members: | ||
- user: 6491d003a634c3c427b69dda | ||
role: student | ||
- user: 6421d9833cdf38b706756d22 | ||
- 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 | ||
Comment on lines
+96
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
createdAt: 2024-12-16T16:01:14.667Z | ||
updatedAt: 2024-12-16T16:01:14.991Z | ||
deletedFor: [] | ||
latestMessage: | ||
_id: 67604eca753afa7bbd3bd9c3 | ||
author: | ||
_id: 67519181170a70623366d30c | ||
firstName: Diana | ||
lastName: Test | ||
authorRole: tutor | ||
text: hi test | ||
chat: 67604eca753afa7bbd3bd9c1 | ||
clearedFor: [] | ||
createdAt: 2024-12-16T16:01:14.916Z | ||
updatedAt: 2024-12-16T16:01:14.916Z | ||
/chats/{id}/messages: | ||
get: | ||
security: | ||
|
@@ -328,12 +368,17 @@ paths: | |
schema: | ||
$ref: '#/definitions/chat' | ||
example: | ||
- _id: 64a54c6c7bca605aaf2da66c | ||
members: | ||
[{ user: 6491d003a634c3c427b69daa, role: tutor }, { user: 6421d9833cdf38b706756dff, role: student }] | ||
deletedFor: [{ user: 6491d003a634c3c427b69daa }] | ||
createdAt: 2023-20-01T13:25:36.292Z | ||
updatedAt: 2023-20-01T13:25:36.292Z | ||
_id: 67604eca753afa7bbd3bd9c1 | ||
members: | ||
- user: 67519181170a70623366d30c | ||
role: tutor | ||
- user: 6735ff2cc8f5e44cc3de002d | ||
role: student | ||
deletedFor: | ||
- user: 67519181170a70623366d30c | ||
createdAt: 2024-12-16T16:01:14.667Z | ||
updatedAt: 2024-12-16T16:20:01.463Z | ||
latestMessage: 67604eca753afa7bbd3bd9c3 | ||
400: | ||
description: Bad Request | ||
content: | ||
|
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, checksrc\models\chat.js