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

API: switch to sortParam #4520

Merged
merged 3 commits into from
Nov 18, 2023
Merged

API: switch to sortParam #4520

merged 3 commits into from
Nov 18, 2023

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Nov 13, 2023

Extracted from #4507

Our various APIs use ?sort, ?ordering or ?order_by for sorting.

Before:

BaseAPI just uses sort (and only deals with page & page_size -> offset & limit mapping),
PulpAPI adds a useOrdering = false; param, and overrides list to map sort to ordering depending on that,
PulpAPI subclasses set useOrdering = true; where applicable,
LegacyAPI adds a sortParam = 'order_by'; and overrides list to map sort to that,
LegacyAPI subclasses setting sortParam to either sort or order_by.

After:

BaseAPI sets sortParam = 'sort';, and maps sort to the value of sortParam in list,
PulpAPI sets sortParam = 'ordering';,
LegacyAPI sets sortParam = 'order_by';,

the exceptions being:

  • collection version using order_by (not sort)
  • EE namespaces using sort (not ordering)
  • role namespaces using sort (not order_by)

The only real change should be that CollectionVersionSearchAPI now uses order_by.

@github-actions github-actions bot added backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) labels Nov 13, 2023
@himdel himdel added cleanup Dead code removal, etc and removed backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) labels Nov 13, 2023
useOrdering logic inverted, changed to sortParam='ordering' by default and override back to sort in EE ns list
sortParam logic moved from legacy to base

and add sortParam to CollectionVersionSearch API

No-Issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Dead code removal, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant