Skip to content

feat(usergroups): add missing team_id argument to usergroups.users.list - #191

Open
maartenpaauw wants to merge 2 commits into
jolicode:mainfrom
maartenpaauw:feat/usergroups-users-list-team-id
Open

feat(usergroups): add missing team_id argument to usergroups.users.list#191
maartenpaauw wants to merge 2 commits into
jolicode:mainfrom
maartenpaauw:feat/usergroups-users-list-team-id

Conversation

@maartenpaauw

Copy link
Copy Markdown

Why

Slack documents team_id as an optional argument for usergroups.users.list:

team_id (string) — The user group's encoded team ID. Required if org token is used.

It's missing from the patched OpenAPI spec, so the generated endpoint rejects it:

$client->usergroupsUsersList([
    'usergroup' => 'S0123',
    'team_id'   => 'T0123', // Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
]);

usergroups.list already carries this same override — this brings usergroups.users.list in line.

What

  • Specification override — add the team_id query parameter to /usergroups.users.list in resources/slack-openapi-patched.json
  • Refresh resources/slack-openapi-sorted.patch (new hunk + cascaded hunk offsets, same shape as Add team_id support for 3 endpoints #140)
  • Regenerate the affected endpoint code (generated/Endpoint/UsergroupsUsersList.php, generated/Client.php docblock)
  • Changelog entry

Verification

  • The patch applies cleanly to slack-openapi-sorted.json and reproduces slack-openapi-patched.json exactly
  • generated/ diff is limited to what a full Jane regen produces for this spec change
  • JsonSorterTest passes (patched spec still correctly sorted)
  • php-cs-fixer --dry-run clean

Note on check-spec

A full jane-openapi generate with the current latest Jane also rewrites a large number of unrelated Normalizer / BaseEndpoint files (Jane template drift since the last full rebuild in #189). That churn is intentionally not included here so this PR stays scoped to team_id. If check-spec fails on that unrelated diff, it reflects the pre-existing Jane-version drift on main rather than this change — happy to rebase once the SDK is rebuilt.

@damienalexandre

Copy link
Copy Markdown
Member

Hello, thank for you contribution, it looks good!

I just updated the SDK on main, can you rebase please?

The `team_id` query parameter is documented by Slack as an optional
argument for `usergroups.users.list` ("The user group's encoded team ID.
Required if org token is used."), but it was absent from the patched
OpenAPI spec, so the generated endpoint rejected it with an
UndefinedOptionsException.

Add it to resources/slack-openapi-patched.json (matching the existing
team_id override on usergroups.list), refresh the community patch file,
and regenerate the affected endpoint code.

Ref: https://docs.slack.dev/reference/methods/usergroups.users.list

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXAVNUu5y3nHkfzq2TdNfX
@maartenpaauw
maartenpaauw force-pushed the feat/usergroups-users-list-team-id branch from d6e23bd to 74f38e9 Compare August 31, 2026 06:37
@maartenpaauw

Copy link
Copy Markdown
Author

@damienalexandre thanks for the quick response! I've rebased my branch and it is up-to-date with main.

@damienalexandre

Copy link
Copy Markdown
Member

Tests are not happy, you need to "composer update" and "vendor/bin/jane-openapi generate --config-file=.jane-openapi.php" I think.

CI regenerates the SDK with the latest JanePHP (currently 7.14.0) and
fails on any diff. Running `composer update` + `jane-openapi generate`
picks up JanePHP 7.14, which reworks parts of the Runtime layer
(FormEncoder/JsonPayload/JsonObject, additional-properties handling),
drops CustomQueryResolver, and adds an `applyServerPlugins` flag to
`Client::create()` that installs php-http host/path plugins from the
OpenAPI server definition.

`ClientFactory` already installs `AddSlackPathAndHostPlugin`, so it now
opts out of those generated server plugins: their `AddPathPlugin` skips
the `/api` prefix for the `api.test` endpoint (its path already starts
with `/api`), which broke `ApiTest`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXAVNUu5y3nHkfzq2TdNfX
@maartenpaauw

Copy link
Copy Markdown
Author

Rebuilt with JanePHP 7.14 (composer update + vendor/bin/jane-openapi generate --config-file=.jane-openapi.php).

That version auto-adds php-http server plugins in Client::create() (new applyServerPlugins flag, default true). Their AddPathPlugin skips the base prefix when the request path already starts with it, so api.test was sent to https://slack.com/api.test → 404 (ApiTest caught this). ClientFactory already installs AddSlackPathAndHostPlugin, so it now calls Client::create($pluginClient, applyServerPlugins: false).

check-spec (rm -rf generated && jane-openapi generate && git diff --exit-code) and check-cs are clean locally; ApiTest passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants