diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index 577871eb81..92282890f3 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,12 +1,14 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 413 - +INVENTREE_API_VERSION = 414 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v414 -> 2025-06-20 : https://github.com/inventree/InvenTree/pull/10629 + - Add enums for all ordering fields in schema - no functional changes + v413 -> 2025-10-20 : https://github.com/inventree/InvenTree/pull/10624 - Upstream fixes to django-allauth schema - no functional changes diff --git a/src/backend/InvenTree/InvenTree/schema.py b/src/backend/InvenTree/InvenTree/schema.py index 4287a621c0..36918d3d95 100644 --- a/src/backend/InvenTree/InvenTree/schema.py +++ b/src/backend/InvenTree/InvenTree/schema.py @@ -105,9 +105,11 @@ class ExtendedAutoSchema(AutoSchema): parameters = operation.get('parameters', []) for parameter in parameters: if parameter['name'] == 'ordering': - parameter['description'] = ( - f'{parameter["description"]} Possible fields: {", ".join(ordering_fields)}.' - ) + schema_order = [] + for field in ordering_fields: + schema_order.append(field) + schema_order.append('-' + field) + parameter['schema']['enum'] = schema_order # Add valid search fields to the search description. search_fields = getattr(self.view, 'search_fields', None)