diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index 6dd42b96ce..977ab1358b 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,11 +1,14 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 374 +INVENTREE_API_VERSION = 375 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v375 -> 2025-07-28 : https://github.com/inventree/InvenTree/pull/10095 + - Sorts searched fields to keep API stable + v374 -> 2025-07-28 : https://github.com/inventree/InvenTree/pull/10092 - Add nullable to a few details fields that lack it - Add the list of searched fields to the search parameter comments diff --git a/src/backend/InvenTree/InvenTree/schema.py b/src/backend/InvenTree/InvenTree/schema.py index 94f72b63c0..ac805e4f28 100644 --- a/src/backend/InvenTree/InvenTree/schema.py +++ b/src/backend/InvenTree/InvenTree/schema.py @@ -105,7 +105,11 @@ class ExtendedAutoSchema(AutoSchema): # Add valid search fields to the search description. search_fields = getattr(self.view, 'search_fields', None) + if search_fields is not None: + # Ensure consistent ordering of search fields + search_fields = sorted(search_fields) + parameters = operation.get('parameters', []) for parameter in parameters: if parameter['name'] == 'search':