Comments (5)
The official typing uses anonymous objects, so it doesn't seem to be treated as ObjsMessage
. However, composing a items[0]
and items[1]
whose properties are completely nullable perfectly partially matches for ObjsMessage
, so it's OK to go with it. This is a much better solution than mixed
.
"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"
}
from slack-php-api.
Or more accurately, we need to provide another typed implementation for them.
from slack-php-api.
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
from slack-php-api.
Oops, the actual API response structure looks like it includes more (perhaps not all) components of ObjsMessage
. It seems to me that there is another major error on slack-api-specs
😢
from slack-php-api.
Hello,
Did you manage to fix your issue? If not, does the latest version fix it?
from slack-php-api.
Related Issues (20)
- No text error code? HOT 4
- Example has syntax error HOT 3
- Type hint on @return is confusing HOT 1
- Method does not specify that exception might be thrown. HOT 4
- Some values not reachable? HOT 4
- UsersList and UsergroupsList should accept new parameter: "team_id" HOT 2
- Don't use deprecated factory method
- Required fields in `Objs*` classes should not be nullable HOT 1
- Question: Recommended endpoint for `response_url` HOT 3
- setNormalizer() must implement interface Symfony\Component\Serializer\Normalizer\NormalizerInterface HOT 1
- Missing @throws in the phpdocs HOT 2
- Support for the Bookmarks API? HOT 2
- Creation of dynamic property JoliCode\Slack\Api\Endpoint\ChatPostMessage::$formParameters is deprecated HOT 5
- Fatal Error Jane\JsonSchemaRuntime\Normalizer\CheckArray HOT 7
- Requirement for Read Only Repo: jane-php/open-api-runtime HOT 1
- Fatal error: Declaration of `ChatPostMessage::transformResponseBody()` must be compatible with `Jane\OpenApiRuntime\Client\EndpointTrait` HOT 1
- Discussion: Jane8 and `psr/http-message:^2.0` HOT 1
- Image Blocks in posts returning "invalid_blocks" error. HOT 1
- Flacky CI due to Slack rate limit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slack-php-api.