Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Add JSON user API #17352

wants to merge 11 commits into from

Conversation

Robin5605
Copy link

Closes #15769

Some points of discussion:

  • Is this added in the right place? Feels strange adding to the legacy JSON API but at the same time it seems to fit in
  • Data model: should we stay faithful to exactly what's returned in the HTML page for /user/{username}? Or should we return other stuff as well?

@Robin5605 Robin5605 requested a review from a team as a code owner January 5, 2025 05:37
Copy link
Member

@woodruffw woodruffw left a 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/legacy/api/json.py Outdated Show resolved Hide resolved
Comment on lines 650 to 655
config.add_route(
"legacy.api.json.user_slash",
"/user/{username}/json/",
factory="warehouse.legacy.api.json.user_factory",
domain=warehouse,
)
Copy link
Member

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 🙂

Copy link
Author

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.

docs/user/api/json.md Outdated Show resolved Hide resolved
docs/user/api/json.md Outdated Show resolved Hide resolved
Robin5605 and others added 4 commits January 7, 2025 23:50
Co-authored-by: William Woodruff <william@yossarian.net>
Co-authored-by: William Woodruff <william@yossarian.net>
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.

Add PyPI User API
2 participants