René's URL Explorer Experiment


Title: Allow for same param name but different contextual usage by gjtorikian · Pull Request #520 · workos/workos-python · GitHub

Open Graph Title: Allow for same param name but different contextual usage by gjtorikian · Pull Request #520 · workos/workos-python

X Title: Allow for same param name but different contextual usage by gjtorikian · Pull Request #520 · workos/workos-python

Description: Description As #519 notes, #512 corrected one problem and introduced another. The param provided by users through the SDK is user_id/ group_id / directory_id; the API accepts parameters as user / group / directory by the API, without the suffix. What I misunderstood was that pagination actually requires the *_id version of these parameters, so while #512 fixed pagination (by using *_id), it went ahead and broke regular API calls (by using the incorrect, suffixless parameters). Makes sense? Yeah, I had to re-read everything a few times myself to understand the difference in usage. The key is in these lines (repeated throughout several API resources, I'm just picking one): response = self._http_client.request( "directory_users", method=REQUEST_METHOD_GET, params=list_params, ) return WorkOSListResource( list_method=self.list_users, list_args=list_params, **ListPage[DirectoryUserWithGroups](**response).model_dump(), ) The request uses list_params, and then the pagination WorkOSListResource uses list_params again. To solve this, I added a function to translate the parameter name, depending on the context it's used. Essentially, this branch keeps the *_id names internally for pagination, then renames to the suffixless version them right before the HTTP call. Documentation Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates. [ ] Yes If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

Open Graph Description: Description As #519 notes, #512 corrected one problem and introduced another. The param provided by users through the SDK is user_id/ group_id / directory_id; the API accepts parameters as user / g...

X Description: Description As #519 notes, #512 corrected one problem and introduced another. The param provided by users through the SDK is user_id/ group_id / directory_id; the API accepts parameters as user / g...

Opengraph URL: https://github.com/workos/workos-python/pull/520

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b76ae544-c650-9dd6-8db5-1f6de25b39c0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBBEE:1E3F:13DE55A:1A97B02:6992D857
html-safe-nonce4d7cb2297796e861f480f0b1b9941d3e1f5b8e77c0beb889b90ffbbcf139f263
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkVFOjFFM0Y6MTNERTU1QToxQTk3QjAyOjY5OTJEODU3IiwidmlzaXRvcl9pZCI6IjQyNDQ3MzgxNDM2MzE5OTU3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf8cc93f7d6817b1de6ddc7221a2ae3ef93fbe14a1e4252877275f651eb030296
hovercard-subject-tagpull_request:3191983704
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/workos/workos-python/pull/520/files
twitter:imagehttps://avatars.githubusercontent.com/u/64050?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/64050?s=400&v=4
og:image:altDescription As #519 notes, #512 corrected one problem and introduced another. The param provided by users through the SDK is user_id/ group_id / directory_id; the API accepts parameters as user / g...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/workos/workos-python git https://github.com/workos/workos-python.git
octolytics-dimension-user_id47638084
octolytics-dimension-user_loginworkos
octolytics-dimension-repository_id226952859
octolytics-dimension-repository_nwoworkos/workos-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226952859
octolytics-dimension-repository_network_root_nwoworkos/workos-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84dcb133269e3cfe6e0296cc85fbacb92cae92bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fworkos%2Fworkos-python%2Fpull%2F520%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fworkos%2Fworkos-python%2Fpull%2F520%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=workos%2Fworkos-python
Reloadhttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
Reloadhttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
Reloadhttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
workos https://patch-diff.githubusercontent.com/workos
workos-pythonhttps://patch-diff.githubusercontent.com/workos/workos-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fworkos%2Fworkos-python
Fork 25 https://patch-diff.githubusercontent.com/login?return_to=%2Fworkos%2Fworkos-python
Star 66 https://patch-diff.githubusercontent.com/login?return_to=%2Fworkos%2Fworkos-python
Code https://patch-diff.githubusercontent.com/workos/workos-python
Issues 12 https://patch-diff.githubusercontent.com/workos/workos-python/issues
Pull requests 16 https://patch-diff.githubusercontent.com/workos/workos-python/pulls
Actions https://patch-diff.githubusercontent.com/workos/workos-python/actions
Security 0 https://patch-diff.githubusercontent.com/workos/workos-python/security
Insights https://patch-diff.githubusercontent.com/workos/workos-python/pulse
Code https://patch-diff.githubusercontent.com/workos/workos-python
Issues https://patch-diff.githubusercontent.com/workos/workos-python/issues
Pull requests https://patch-diff.githubusercontent.com/workos/workos-python/pulls
Actions https://patch-diff.githubusercontent.com/workos/workos-python/actions
Security https://patch-diff.githubusercontent.com/workos/workos-python/security
Insights https://patch-diff.githubusercontent.com/workos/workos-python/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fworkos%2Fworkos-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fworkos%2Fworkos-python%2Fissues%2Fnew%2Fchoose
gjtorikianhttps://patch-diff.githubusercontent.com/gjtorikian
mainhttps://patch-diff.githubusercontent.com/workos/workos-python/tree/main
wrong-params-againhttps://patch-diff.githubusercontent.com/workos/workos-python/tree/wrong-params-again
Conversation 3 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520
Commits 3 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/commits
Checks 10 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/checks
Files changed 2 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
Allow for same param name but different contextual usage https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#top
Show all changes 3 commits https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
c42dcae Allow for same param name but different contextual usage gjtorikian Jan 20, 2026 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/commits/c42dcae1d59ac3b00d9a5f18904cc98c68044fc8
bd7e377 Use `Union` for compatability with older Pythons gjtorikian Jan 20, 2026 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/commits/bd7e3775351b6d2962ec29b02c0a7ba5427f9386
fd510e2 greptile has opinions gjtorikian Jan 20, 2026 https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/commits/fd510e28333e4c84cbb7a7a06e86e013a098ed07
Clear filters https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
Please reload this pagehttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
Please reload this pagehttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files
directory_sync.py https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
test_directory_sync.py https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/blob/main/.github/CODEOWNERS#L5
src/workos/directory_sync.pyhttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
View file https://patch-diff.githubusercontent.com/workos/workos-python/blob/fd510e28333e4c84cbb7a7a06e86e013a098ed07/src/workos/directory_sync.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-b2c735467a11c85080b20207cfa8120dd5f043a543e95d38a969aa35f12df4a5
https://patch-diff.githubusercontent.com/workos/workos-python/blob/main/.github/CODEOWNERS#L5
tests/test_directory_sync.pyhttps://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
View file https://patch-diff.githubusercontent.com/workos/workos-python/blob/fd510e28333e4c84cbb7a7a06e86e013a098ed07/tests/test_directory_sync.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://patch-diff.githubusercontent.com/workos/workos-python/pull/520/files#diff-55ae75c5b12a65b866e973b3cb12a2caee1f0a29de8cc78fd35a0fd3754466e0
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.