-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSON user API #17352
base: main
Are you sure you want to change the base?
Add JSON user API #17352
Conversation
Add the `/user/{username}/json` and `/user/{username}/json/` routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Robin5605! I did a quick pass on this, a couple of comments inline.
(This review wasn't for approval of the feature itself, just quality. An actual maintainer will need to bless it.)
warehouse/routes.py
Outdated
config.add_route( | ||
"legacy.api.json.user_slash", | ||
"/user/{username}/json/", | ||
factory="warehouse.legacy.api.json.user_factory", | ||
domain=warehouse, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a dedicates route for the slash variant seems a little funky (versus redirecting), but I see it's what we do for the other routes under legacy.api
. Curious if @miketheman or @di has thoughts about this 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. For now I've just done what the other routes are doing but something cleaner would be nice.
Co-authored-by: William Woodruff <william@yossarian.net>
Co-authored-by: William Woodruff <william@yossarian.net>
Closes #15769
Some points of discussion:
/user/{username}
? Or should we return other stuff as well?