Skip to content

Commit

Permalink
Renames ordering parameter from "ordering" to "_order" (#495)
Browse files Browse the repository at this point in the history
* Renames ordering parameter from "ordering" to "_order"

* Updates openapi spec
  • Loading branch information
djperrefort authored Dec 4, 2024
1 parent 627390c commit 10a8f41
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 79 deletions.
156 changes: 78 additions & 78 deletions docs/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ paths:
operationId: allocations_allocations_list
description: Manage HPC resource allocations.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -168,12 +174,6 @@ paths:
name: id__lte
schema:
type: integer
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: request
schema:
Expand Down Expand Up @@ -378,6 +378,12 @@ paths:
operationId: allocations_attachments_list
description: Files submitted as attachments to allocation requests
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -417,12 +423,6 @@ paths:
name: id__lte
schema:
type: integer
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: request
schema:
Expand Down Expand Up @@ -665,6 +665,12 @@ paths:
operationId: allocations_clusters_list
description: Configuration settings for managed Slurm clusters.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -779,12 +785,6 @@ paths:
name: name__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
tags:
- allocations
security:
Expand Down Expand Up @@ -939,6 +939,12 @@ paths:
operationId: allocations_requests_list
description: Manage allocation requests.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -1125,12 +1131,6 @@ paths:
name: id__lte
schema:
type: integer
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: status
schema:
Expand Down Expand Up @@ -1446,6 +1446,12 @@ paths:
operationId: allocations_reviews_list
description: Manage administrator reviews of allocation requests.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -1556,12 +1562,6 @@ paths:
name: last_modified__year
schema:
type: number
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: private_comments
schema:
Expand Down Expand Up @@ -1964,6 +1964,12 @@ paths:
operationId: logs_apps_list
description: Returns application log data.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -2152,12 +2158,6 @@ paths:
name: name__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: pathname
schema:
Expand Down Expand Up @@ -2329,6 +2329,12 @@ paths:
operationId: logs_requests_list
description: Returns HTTP request log data.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -2484,12 +2490,6 @@ paths:
name: method__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: remote_address
schema:
Expand Down Expand Up @@ -2682,6 +2682,12 @@ paths:
operationId: logs_tasks_list
description: Returns results from scheduled background tasks.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -2950,12 +2956,6 @@ paths:
name: meta__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: periodic_task_name
schema:
Expand Down Expand Up @@ -3278,6 +3278,12 @@ paths:
operationId: research_grants_list
description: Track funding awards and grant information.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -3500,12 +3506,6 @@ paths:
name: id__lte
schema:
type: integer
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: start_date
schema:
Expand Down Expand Up @@ -3765,6 +3765,12 @@ paths:
operationId: research_publications_list
description: Manage metadata for research publications.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -3950,12 +3956,6 @@ paths:
name: journal__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: team
schema:
Expand Down Expand Up @@ -4156,6 +4156,12 @@ paths:
operationId: users_membership_list
description: Manage team membership.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -4195,12 +4201,6 @@ paths:
name: id__lte
schema:
type: integer
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: role
schema:
Expand Down Expand Up @@ -4444,6 +4444,12 @@ paths:
operationId: users_teams_list
description: Manage user teams.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -4529,12 +4535,6 @@ paths:
name: name__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
tags:
- users
security:
Expand Down Expand Up @@ -4689,6 +4689,12 @@ paths:
operationId: users_users_list
description: Manage user account data.
parameters:
- name: _order
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- name: _search
required: false
in: query
Expand Down Expand Up @@ -5054,12 +5060,6 @@ paths:
name: last_name__startswith
schema:
type: string
- name: ordering
required: false
in: query
description: Which field to use when ordering the results.
schema:
type: string
- in: query
name: password
schema:
Expand Down
3 changes: 2 additions & 1 deletion keystone_api/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@
# REST API settings

REST_FRAMEWORK = {
'SEARCH_PARAM': '_search',
'ORDERING_PARAM': '_order',
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated'
],
Expand All @@ -181,7 +183,6 @@
'rest_framework.filters.OrderingFilter',
'rest_framework.filters.SearchFilter'
),
'SEARCH_PARAM': '_search',
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
}

Expand Down

0 comments on commit 10a8f41

Please sign in to comment.