mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:13:39 +08:00
FIX: serializes interaction for direct messages (#29844)
Prior to this fix it would cause an error as we need to pass the user to get the title of the channel. This commit also adds a test for message interaction serializer.
This commit is contained in:
101
plugins/chat/spec/support/api/schemas/message_interaction.json
Normal file
101
plugins/chat/spec/support/api/schemas/message_interaction.json
Normal file
@ -0,0 +1,101 @@
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"action",
|
||||
"channel",
|
||||
"message",
|
||||
"user"
|
||||
],
|
||||
"properties": {
|
||||
"action": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"action_id",
|
||||
"schema_version",
|
||||
"text",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"action_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"schema_version": {
|
||||
"type": "integer"
|
||||
},
|
||||
"text": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"text",
|
||||
"type"
|
||||
],
|
||||
"properties": {
|
||||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"plain_text"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"button"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"channel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"title"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"message": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"text",
|
||||
"user_id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"user_id": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"username"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user