Skip to content

Commit 01f04a4

Browse files
committed
add deterministic pagination to submodel_refs
1 parent 9aa3aa6 commit 01f04a4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server/app/interfaces/repository.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This program and the accompanying materials are made available under the terms of the MIT License, available in
44
# the LICENSE file of this project.
55
#
6-
# SPDX-License-Identifier: MIT
6+
# SPDX-License-Identifier: MITd
77
"""
88
This module implements the "Specification of the Asset Administration Shell Part 2 Application Programming Interfaces".
99
However, several features and routes are currently not supported:
@@ -419,7 +419,8 @@ def get_aas_submodel_refs(self, request: Request, url_args: Dict, response_t: Ty
419419
**_kwargs) -> Response:
420420
aas = self._get_shell(url_args)
421421
submodel_refs: Iterator[model.ModelReference[model.Submodel]]
422-
submodel_refs, cursor = self._get_slice(request, aas.submodel)
422+
sorted_submodel_refs = sorted(aas.submodel, key=lambda ref: ref.key[0].value)
423+
submodel_refs, cursor = self._get_slice(request, sorted_submodel_refs)
423424
return response_t(list(submodel_refs), cursor=cursor)
424425

425426
def post_aas_submodel_refs(self, request: Request, url_args: Dict, response_t: Type[APIResponse],

0 commit comments

Comments
 (0)