server/app/interfaces: update AAS- and SubmodelRepository API to V3.1#421
Draft
Frosty2500 wants to merge 7 commits intoeclipse-basyx:developfrom
Draft
server/app/interfaces: update AAS- and SubmodelRepository API to V3.1#421Frosty2500 wants to merge 7 commits intoeclipse-basyx:developfrom
Frosty2500 wants to merge 7 commits intoeclipse-basyx:developfrom
Conversation
Member
|
We need to wait with merging this PR until we release v2.0.0. |
Member
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the AAS- and SubmodelRepository servers from version 3.01 to version 3.1 and fixes some bugs.