-
Notifications
You must be signed in to change notification settings - Fork 58
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
ConversationsRepliesGetResponse200 should provide typing for messages
other than mixed[]
#136
Comments
The official typing uses anonymous objects, so it doesn't seem to be treated as "messages": {
"items": {
"items": [
{
"additionalProperties": false,
"properties": {
"last_read": {
"$ref": "#/definitions/defs_ts"
},
"latest_reply": {
"$ref": "#/definitions/defs_ts"
},
"reply_count": {
"type": "integer"
},
"reply_users": {
"items": {
"$ref": "#/definitions/defs_user_id"
},
"type": "array",
"uniqueItems": true
},
"reply_users_count": {
"type": "integer"
},
"source_team": {
"$ref": "#/definitions/defs_team"
},
"subscribed": {
"type": "boolean"
},
"team": {
"$ref": "#/definitions/defs_team"
},
"text": {
"type": "string"
},
"thread_ts": {
"$ref": "#/definitions/defs_ts"
},
"ts": {
"$ref": "#/definitions/defs_ts"
},
"type": {
"type": "string"
},
"unread_count": {
"type": "integer"
},
"user": {
"$ref": "#/definitions/defs_user_id"
},
"user_profile": {
"$ref": "#/definitions/objs_user_profile_short"
},
"user_team": {
"$ref": "#/definitions/defs_team"
}
},
"required": [
"type",
"user",
"text",
"thread_ts",
"reply_count",
"subscribed",
"ts"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"is_starred": {
"type": "boolean"
},
"parent_user_id": {
"$ref": "#/definitions/defs_user_id"
},
"source_team": {
"$ref": "#/definitions/defs_team"
},
"team": {
"$ref": "#/definitions/defs_team"
},
"text": {
"type": "string"
},
"thread_ts": {
"$ref": "#/definitions/defs_ts"
},
"ts": {
"$ref": "#/definitions/defs_ts"
},
"type": {
"type": "string"
},
"user": {
"$ref": "#/definitions/defs_user_id"
},
"user_profile": {
"$ref": "#/definitions/objs_user_profile_short"
},
"user_team": {
"$ref": "#/definitions/defs_team"
}
},
"required": [
"type",
"user",
"text",
"thread_ts",
"parent_user_id",
"ts"
],
"type": "object"
}
]
},
"type": "array"
} "objs_message": {
"additionalProperties": false,
"properties": {
"attachments": {
"items": {
"additionalProperties": false,
"properties": {
"fallback": {
"type": "string"
},
"id": {
"type": "integer"
},
"image_bytes": {
"type": "integer"
},
"image_height": {
"type": "integer"
},
"image_url": {
"type": "string"
},
"image_width": {
"type": "integer"
}
},
"required": [
"id"
],
"type": "object"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"blocks": {
"$ref": "#/definitions/blocks"
},
"bot_id": {
"items": [
{
"$ref": "#/definitions/defs_bot_id"
},
{
"title": "Nil bot_id set when display_as_bot is false",
"type": "null"
}
]
},
"bot_profile": {
"$ref": "#/definitions/objs_bot_profile"
},
"client_msg_id": {
"type": "string"
},
"comment": {
"$ref": "#/definitions/objs_comment"
},
"display_as_bot": {
"type": "boolean"
},
"file": {
"$ref": "#/definitions/objs_file"
},
"files": {
"items": {
"$ref": "#/definitions/objs_file"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"icons": {
"additionalProperties": false,
"properties": {
"emoji": {
"type": "string"
},
"image_64": {
"format": "uri",
"type": "string"
}
},
"type": "object"
},
"inviter": {
"$ref": "#/definitions/defs_user_id"
},
"is_delayed_message": {
"type": "boolean"
},
"is_intro": {
"type": "boolean"
},
"is_starred": {
"type": "boolean"
},
"last_read": {
"$ref": "#/definitions/defs_ts"
},
"latest_reply": {
"$ref": "#/definitions/defs_ts"
},
"name": {
"type": "string"
},
"old_name": {
"type": "string"
},
"parent_user_id": {
"$ref": "#/definitions/defs_user_id"
},
"permalink": {
"format": "uri",
"type": "string"
},
"pinned_to": {
"items": {
"$ref": "#/definitions/defs_channel"
},
"type": "array"
},
"purpose": {
"type": "string"
},
"reactions": {
"items": {
"$ref": "#/definitions/objs_reaction"
},
"type": "array"
},
"reply_count": {
"type": "integer"
},
"reply_users": {
"items": {
"$ref": "#/definitions/defs_user_id"
},
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"reply_users_count": {
"type": "integer"
},
"source_team": {
"$ref": "#/definitions/defs_workspace_id"
},
"subscribed": {
"type": "boolean"
},
"subtype": {
"type": "string"
},
"team": {
"$ref": "#/definitions/defs_workspace_id"
},
"text": {
"type": "string"
},
"thread_ts": {
"$ref": "#/definitions/defs_ts"
},
"topic": {
"type": "string"
},
"ts": {
"$ref": "#/definitions/defs_ts"
},
"type": {
"type": "string"
},
"unread_count": {
"type": "integer"
},
"upload": {
"type": "boolean"
},
"user": {
"$ref": "#/definitions/defs_user_id"
},
"user_profile": {
"$ref": "#/definitions/objs_user_profile_short"
},
"user_team": {
"$ref": "#/definitions/defs_workspace_id"
},
"username": {
"type": "string"
}
},
"required": [
"text",
"type",
"ts"
],
"title": "Message object",
"type": "object"
} |
Or more accurately, we need to provide another typed implementation for them. |
messages
, not mixed[]
messages
, not mixed[]
messages
other than mixed[]
Diff Individual--- objs_message.txt 2022-01-24 11:53:04.000000000 +0900
+++ objs_message_reply_thread.txt 2022-01-24 11:59:33.000000000 +0900
-attachments
-blocks
-bot_id
-bot_profile
-client_msg_id
-comment
-display_as_bot
-file
-files
-icons
-inviter
-is_delayed_message
-is_intro
-is_starred
last_read
latest_reply
-name
-old_name
-parent_user_id
-permalink
-pinned_to
-purpose
-reactions
reply_count
reply_users
reply_users_count
source_team
subscribed
-subtype
team
text
thread_ts
-topic
ts
type
unread_count
-upload
user
user_profile
-username --- objs_message.txt 2022-01-24 11:53:04.000000000 +0900
+++ objs_message_reply_child.txt 2022-01-24 11:59:53.000000000 +0900
-attachments
-blocks
-bot_id
-bot_profile
-client_msg_id
-comment
-display_as_bot
-file
-files
-icons
-inviter
-is_delayed_message
-is_intro
is_starred
-last_read
-latest_reply
-name
-old_name
parent_user_id
-permalink
-pinned_to
-purpose
-reactions
-reply_count
-reply_users
-reply_users_count
source_team
-subscribed
-subtype
team
text
thread_ts
-topic
ts
type
-unread_count
-upload
user
user_profile
-user_team
-username Merged--- objs_message.txt 2022-01-24 11:53:04.000000000 +0900
+++ objs_message_reply_merged.txt 2022-01-24 11:53:28.000000000 +0900
-attachments
-blocks
-bot_id
-bot_profile
-client_msg_id
-comment
-display_as_bot
-file
-files
-icons
-inviter
-is_delayed_message
-is_intro
is_starred
last_read
latest_reply
-name
-old_name
parent_user_id
-permalink
-pinned_to
-purpose
-reactions
reply_count
reply_users
reply_users_count
source_team
subscribed
-subtype
team
text
thread_ts
-topic
ts
type
unread_count
-upload
user
user_profile
user_team
-username |
Oops, the actual API response structure looks like it includes more (perhaps not all) components of |
Hello, Did you manage to fix your issue? If not, does the latest version fix it? |
slack-php-api/generated/Model/ConversationsRepliesGetResponse200.php
Lines 47 to 63 in 836217b
It should not bemixed[]
butObjsMessage[]
.It should be assigned the type other than
mixed[]
.The text was updated successfully, but these errors were encountered: