Skip to content

Updated browse endpoint to use parse_comma_separated_list#12228

Merged
RayBB merged 2 commits intointernetarchive:masterfrom
Sanket17052006:update-browse
Mar 31, 2026
Merged

Updated browse endpoint to use parse_comma_separated_list#12228
RayBB merged 2 commits intointernetarchive:masterfrom
Sanket17052006:update-browse

Conversation

@Sanket17052006
Copy link
Copy Markdown
Contributor

Follow up #12006

Changes :

  • Replaced the manual string splitting logic sorts_list = [s.strip() for s in sorts.split(",") if s.strip()] in the /browse.json with parse_comma_separated_list .

Screenshot

N/A

Stakeholders

@RayBB

Comment thread openlibrary/fastapi/internal/api.py Outdated
q: Annotated[str, Query()] = "",
subject: Annotated[str, Query()] = "",
sorts: Annotated[str, Query()] = "",
sorts: Annotated[list[str] | None, BeforeValidator(parse_comma_separated_list), Query()] = None,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

Copy link
Copy Markdown
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put on testing and it's working as expected. Thanks for doing this one!

@RayBB RayBB merged commit 75edaf7 into internetarchive:master Mar 31, 2026
3 checks passed
@RayBB RayBB self-assigned this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants