Skip to content

Commit 796bd38

Browse files
Ref #91 Switch As User to always be BOOLEAN (#95)
1 parent c5ecc95 commit 796bd38

File tree

6 files changed

+62
-18
lines changed

6 files changed

+62
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* **Specification override** Allow string and integer for the "post_at" field in chatScheduleMessage
66
* Upstream specification update (minor)
7+
* **Specification override** Switch all `as_user` parameters as boolean to fix a breaking change introduced in 3.0.0
78

89
## 3.0.1 (2020-08-26)
910

generated/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ public function chatPostEphemeral(array $formParameters = [], array $headerParam
14671467
* @var string $text How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
14681468
* @var bool $unfurl_media pass false to disable unfurling of media content
14691469
* @var string $parse Change how messages are treated. Defaults to `none`. See [below](#formatting).
1470-
* @var string $as_user Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.
1470+
* @var bool $as_user Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.
14711471
* @var bool $mrkdwn Disable Slack markup parsing by setting to `false`. Enabled by default.
14721472
* @var string $channel Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.
14731473
* @var string $blocks a JSON-based array of structured blocks, presented as a URL-encoded string
@@ -1586,7 +1586,7 @@ public function chatUnfurl(array $formParameters = [], array $headerParameters =
15861586
*
15871587
* @var string $blocks a JSON-based array of structured blocks, presented as a URL-encoded string
15881588
* @var string $attachments A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting `text`.
1589-
* @var string $as_user Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.
1589+
* @var bool $as_user Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.
15901590
* @var string $ts timestamp of the message to be updated
15911591
* @var string $parse Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. See [below](#formatting).
15921592
* @var string $text New text for the message, using the [default formatting rules](/docs/formatting). It's not required when presenting `attachments`.

generated/Endpoint/ChatPostMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ChatPostMessage extends \Jane\OpenApiRuntime\Client\BaseEndpoint implement
2727
* @var string $text How this field works and whether it is required depends on other fields you use in your API call. [See below](#text_usage) for more detail.
2828
* @var bool $unfurl_media pass false to disable unfurling of media content
2929
* @var string $parse Change how messages are treated. Defaults to `none`. See [below](#formatting).
30-
* @var string $as_user Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.
30+
* @var bool $as_user Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.
3131
* @var bool $mrkdwn Disable Slack markup parsing by setting to `false`. Enabled by default.
3232
* @var string $channel Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.
3333
* @var string $blocks a JSON-based array of structured blocks, presented as a URL-encoded string
@@ -86,7 +86,7 @@ protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\
8686
$optionsResolver->setAllowedTypes('text', ['string']);
8787
$optionsResolver->setAllowedTypes('unfurl_media', ['bool']);
8888
$optionsResolver->setAllowedTypes('parse', ['string']);
89-
$optionsResolver->setAllowedTypes('as_user', ['string']);
89+
$optionsResolver->setAllowedTypes('as_user', ['bool']);
9090
$optionsResolver->setAllowedTypes('mrkdwn', ['bool']);
9191
$optionsResolver->setAllowedTypes('channel', ['string']);
9292
$optionsResolver->setAllowedTypes('blocks', ['string']);

generated/Endpoint/ChatUpdate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ChatUpdate extends \Jane\OpenApiRuntime\Client\BaseEndpoint implements \Ja
2424
*
2525
* @var string $blocks a JSON-based array of structured blocks, presented as a URL-encoded string
2626
* @var string $attachments A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting `text`.
27-
* @var string $as_user Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.
27+
* @var bool $as_user Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.
2828
* @var string $ts timestamp of the message to be updated
2929
* @var string $parse Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. See [below](#formatting).
3030
* @var string $text New text for the message, using the [default formatting rules](/docs/formatting). It's not required when presenting `attachments`.
@@ -76,7 +76,7 @@ protected function getFormOptionsResolver(): \Symfony\Component\OptionsResolver\
7676
$optionsResolver->setDefaults([]);
7777
$optionsResolver->setAllowedTypes('blocks', ['string']);
7878
$optionsResolver->setAllowedTypes('attachments', ['string']);
79-
$optionsResolver->setAllowedTypes('as_user', ['string']);
79+
$optionsResolver->setAllowedTypes('as_user', ['bool']);
8080
$optionsResolver->setAllowedTypes('ts', ['string']);
8181
$optionsResolver->setAllowedTypes('parse', ['string']);
8282
$optionsResolver->setAllowedTypes('text', ['string']);

resources/slack-openapi-patched.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10771,7 +10771,7 @@
1077110771
"description": "Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.",
1077210772
"in": "formData",
1077310773
"name": "as_user",
10774-
"type": "string"
10774+
"type": "boolean"
1077510775
},
1077610776
{
1077710777
"description": "Disable Slack markup parsing by setting to `false`. Enabled by default.",
@@ -11612,7 +11612,7 @@
1161211612
"description": "Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.",
1161311613
"in": "formData",
1161411614
"name": "as_user",
11615-
"type": "string"
11615+
"type": "boolean"
1161611616
},
1161711617
{
1161811618
"description": "Timestamp of the message to be updated.",

resources/slack-openapi-sorted.patch

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- resources/slack-openapi-sorted.json 2020-09-24 14:28:16.317703122 +0200
2-
+++ resources/slack-openapi-patched.json 2020-09-24 14:28:45.805940716 +0200
1+
--- resources/slack-openapi-sorted.json 2020-10-20 19:05:20.339337957 +0200
2+
+++ resources/slack-openapi-patched.json 2020-10-20 19:21:37.101137417 +0200
33
@@ -415,763 +415,331 @@
44
],
55
"title": "File Comment Object",
@@ -123,8 +123,8 @@
123123
- "type": "boolean"
124124
- },
125125
- "is_moved": {
126-
"type": "integer"
127-
},
126+
- "type": "integer"
127+
- },
128128
- "is_mpim": {
129129
- "enum": [
130130
- false
@@ -291,8 +291,8 @@
291291
- "uniqueItems": true
292292
- },
293293
- "timezone_count": {
294-
- "type": "integer"
295-
- },
294+
"type": "integer"
295+
},
296296
- "topic": {
297297
- "additionalProperties": false,
298298
- "properties": {
@@ -1470,11 +1470,11 @@
14701470
+ },
14711471
+ "is_bot": {
14721472
+ "type": "boolean"
1473-
},
1474-
- {
1473+
+ },
14751474
+ "is_invited_user": {
14761475
+ "type": "boolean"
1477-
+ },
1476+
},
1477+
- {
14781478
+ "is_owner": {
14791479
+ "type": "boolean"
14801480
+ },
@@ -2953,6 +2953,29 @@
29532953
},
29542954
{
29552955
"description": "`id` of the user who will receive the ephemeral message. The user should be in the channel specified by the `channel` argument.",
2956+
@@ -11253,21 +10764,21 @@
2957+
{
2958+
"description": "Change how messages are treated. Defaults to `none`. See [below](#formatting).",
2959+
"in": "formData",
2960+
"name": "parse",
2961+
"type": "string"
2962+
},
2963+
{
2964+
"description": "Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See [authorship](#authorship) below.",
2965+
"in": "formData",
2966+
"name": "as_user",
2967+
- "type": "string"
2968+
+ "type": "boolean"
2969+
},
2970+
{
2971+
"description": "Disable Slack markup parsing by setting to `false`. Enabled by default.",
2972+
"in": "formData",
2973+
"name": "mrkdwn",
2974+
"type": "boolean"
2975+
},
2976+
{
2977+
"description": "Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See [below](#channels) for more details.",
2978+
"in": "formData",
29562979
@@ -11308,21 +10819,20 @@
29572980
{
29582981
"description": "Set your bot's user name. Must be used in conjunction with `as_user` set to false, otherwise ignored. See [authorship](#authorship) below.",
@@ -3184,7 +3207,27 @@
31843207
"type": "string"
31853208
}
31863209
],
3187-
@@ -12091,21 +11624,20 @@
3210+
@@ -12072,40 +11605,39 @@
3211+
{
3212+
"description": "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting `text`.",
3213+
"in": "formData",
3214+
"name": "attachments",
3215+
"type": "string"
3216+
},
3217+
{
3218+
"description": "Pass true to update the message as the authed user. [Bot users](/bot-users) in this context are considered authed users.",
3219+
"in": "formData",
3220+
"name": "as_user",
3221+
- "type": "string"
3222+
+ "type": "boolean"
3223+
},
3224+
{
3225+
"description": "Timestamp of the message to be updated.",
3226+
"in": "formData",
3227+
"name": "ts",
3228+
"required": true,
3229+
"type": "string"
3230+
},
31883231
{
31893232
"description": "Change how messages are treated. Defaults to `client`, unlike `chat.postMessage`. Accepts either `none` or `full`. See [below](#formatting).",
31903233
"in": "formData",

0 commit comments

Comments
 (0)