server/app/interfaces: update AAS- and SubmodelRepository API to V3.1#421
server/app/interfaces: update AAS- and SubmodelRepository API to V3.1#421Frosty2500 wants to merge 7 commits intoeclipse-basyx:developfrom
Conversation
|
We need to wait with merging this PR until we release v2.0.0. |
|
I've updated this branch, the merge conflicts were quite complex due to the refactoring we did while this PR was already out. Currently, there's a typing issue: @classmethod
def _get_slice(cls, request: Request, iterator: Iterable[T]) -> Tuple[Iterator[T], int]:
limit_str = request.args.get('limit', default="10")
cursor_str = request.args.get('cursor', default="1")
try:
limit, cursor = int(limit_str), int(cursor_str) - 1 # cursor is 1-indexed
if limit < 0 or cursor < 0:
raise ValueError
except ValueError:
raise BadRequest("Limit can not be negative, cursor must be positive!")
start_index = cursor
end_index = cursor + limit
items = list(itertools.islice(iterator, start_index, end_index + 1))
has_more = len(items) > limit
paginated_slice = iter(items[:limit])
next_cursor = cursor + limit if has_more else None
return paginated_slice, next_cursorAs it is implemented, it actually returns Furthermore, @moritzsommer, could you review the |
|
I did some research and found:
But this is with regards to how the client needs to form the request, not how the server needs to respond. |
This PR updates the AAS- and SubmodelRepository servers from version 3.01 to version 3.1 and fixes some bugs.