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

Make the collection API parameters stable #3919

Open
obulat opened this issue Mar 14, 2024 · 2 comments
Open

Make the collection API parameters stable #3919

obulat opened this issue Mar 14, 2024 · 2 comments
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API ⛔ status: blocked Blocked & therefore, not ready for work

Comments

@obulat
Copy link
Contributor

obulat commented Mar 14, 2024

Problem

#3887 adds some unstable__ query parameters for the Additional search views project.

Description

Remove the unstable__ prefix from unstable__collection and unstable__tag. Update the documentation to always show the full description for collection, tag, source and creator parameters.
Updated: this is a single-step change.

Additional context

Blocked until the project is launched.

Alternatives

This change could be implemented in 3 steps:

  • make the API accept both unstable__ and stable variants (i.e., unstable__collection and collection)
  • update the frontend code to use only the stable parameter names (collection and tag)
  • remove the unstable__ parameters from the API.
    But it's easier to make the API change in one step, and make transition smooth in the frontend.
@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository ⛔ status: blocked Blocked & therefore, not ready for work 🧱 stack: api Related to the Django API labels Mar 14, 2024
@openverse-bot openverse-bot moved this to ⛔ Blocked in Openverse Backlog Mar 14, 2024
@sarayourfriend
Copy link
Collaborator

sarayourfriend commented Mar 18, 2024

I agree with the approach you've described. The only alternative is to flip the first two steps (sort of) and have the frontend send both, until the API moves to only accept the stable version, then start only sending one from the frontend. Depending on the complexity of either, that could be preferrable. Handing two names for the same parameter might be slightly more complex in DRF serializers than e.g., updating the frontend code to temporarily send the parameter with both names.

@obulat
Copy link
Contributor Author

obulat commented Mar 19, 2024

I agree with the approach you've described. The only alternative is to flip the first two steps (sort of) and have the frontend send both, until the API moves to only accept the stable version, then start only sending one from the frontend. Depending on the complexity of either, that could be preferrable. Handing two names for the same parameter might be slightly more complex in DRF serializers than e.g., updating the frontend code to temporarily send the parameter with both names.

That's a great idea! I also think that adding an extra parameter to the frontend is easier, than adding serializers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: api Related to the Django API ⛔ status: blocked Blocked & therefore, not ready for work
Projects
Status: ⛔ Blocked
Development

No branches or pull requests

2 participants