fix: listEnvironmentRoles should not use PaginatedResource#341
Merged
gjtorikian merged 1 commit intomainfrom Mar 9, 2026
Merged
fix: listEnvironmentRoles should not use PaginatedResource#341gjtorikian merged 1 commit intomainfrom
gjtorikian merged 1 commit intomainfrom
Conversation
The authorization/roles endpoint is not paginated, so using PaginatedResource causes an "Undefined array key list_metadata" error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR fixes a runtime bug in Key changes:
Confidence Score: 5/5
Sequence DiagramsequenceDiagram
participant Caller
participant RBAC
participant Client
participant API as WorkOS API
Caller->>RBAC: listEnvironmentRoles()
RBAC->>Client: GET authorization/roles
Client->>API: HTTP GET /authorization/roles
API-->>Client: { "object": "list", "data": [...] }
Client-->>RBAC: $response (array)
loop foreach $response["data"]
RBAC->>RBAC: Role::constructFromResponse($responseData)
end
RBAC-->>Caller: Role[]
Last reviewed commit: e6046d8 |
gjtorikian
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
authorization/rolesendpoint is not paginated, butlistEnvironmentRoleswas usingPaginatedResource::constructFromResponsewhich callsparsePaginationArgsand expectslist_metadatain the responseUndefined array key "list_metadata"error when customers calledlistEnvironmentRoles$response["data"]directly and returnResource\Role[], matchinglistOrganizationRolesTest plan
listEnvironmentRolesreturns roles without error🤖 Generated with Claude Code