jolicode / slack-php-api

:hash: PHP Slack Client based on the official OpenAPI specification
https://jolicode.github.io/slack-php-api/
MIT License
221 stars 54 forks source link

UsersList and UsergroupsList should accept new parameter: "team_id" #137

Closed mpyw closed 2 years ago

mpyw commented 2 years ago

API specs with JSON schema do not contain parameter "team_id":

but it appears on official Web documentation:


Currently I'm patching like this :(

$response = $this->client->executeEndpoint(new class ($params) extends Endpoint\UsersList {
    protected function getQueryOptionsResolver(): OptionsResolver
    {
        $resolver = parent::getQueryOptionsResolver();
        $resolver->define('team_id');
        $resolver->setAllowedTypes('team_id', ['string']);

        return $resolver;
    }
});
$response = $this->client->executeEndpoint(new class ($params) extends Endpoint\UsergroupsList {
    protected function getQueryOptionsResolver(): OptionsResolver
    {
        $resolver = parent::getQueryOptionsResolver();
        $resolver->define('team_id');
        $resolver->setAllowedTypes('team_id', ['string']);

        return $resolver;
    }
});
mpyw commented 2 years ago

Related: #129

Also missing for ConversationsList

damienalexandre commented 2 years ago

Thanks for reporting this :+1: Indeed we need to patch the specification again, following this tutorial: https://github.com/jolicode/slack-php-api/blob/main/docs/4-updating-sdk.md.

As you can see we maintain a patch file https://github.com/jolicode/slack-php-api/blob/main/resources/slack-openapi-sorted.patch for the official specification as it often broken or wrong.

Is that something you would like to give a try?