[QUESTION] Support both /users/{user_id} and /users/_bulk
See original GitHub issueI have /users
API that supports PUT and GET for /users/{user_id}
. Now I want to introduce a bulk API to update several users at once. I thought about introducing /users/_bulk
endpoint for PUT operations - we don’t allow _
in our IDs hence there is no URL collision.
However when trying to implement it in FastAPI they do collide and /users/_bulk
gets routed to /users/{user_id}
.
In our old system we use aiohttp which stores routes just a a list. Hence, to solve the above “collision” we just sort routes as
paths = sorted(paths, key=lambda x: x.count("{"))
which effectively pushes more vague, pattern routes down the list.
Do you think it will be a valid request for FastAPI to do the same?
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Bulk create users in Azure Active Directory - Microsoft Learn
In Azure AD, select Users > Bulk create. On the Bulk create user page, select Download to receive a valid comma-separated values (CSV)...
Read more >How do I enable or disable products for multiple users (bulk ...
Select Select all < # > to select all users in your account. · Select specific users manually. · Use the "Filter category"...
Read more >Assign tokens to multiple users bulk mode
I have several service accounts and need to assign multiple tokens to each one. Is there a bulk update way to do that?...
Read more >Manage users | Bulk CSV upload - Adobe Support
How to manage multiple users. This article covers the following: Add users by CSV; Edit user details ...
Read more >Create Bulk Users in Active Directory (Step-By-Step Guide)
Below is the PowerShell command to get all domain users. ... In addition, it supports advanced options that are difficult to code with ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
/CC @motinani, @worroc
Hi @tiangolo, I moved to new place where I’m not involved with FastAPI anymore. I’d like to once again express my deep gratitude to you for creating this amazing project!
Found the reason why it seemed to work regardless of the order - by accident I defined bulk endpoint as
/users/_bulk/
with trailing/
while/users/{user_id}
without.Such a waste of everyone’s time 😐
Thank you @euri10 and @tiangolo for looking into this.