Skip to content

Commit f9b94e0

Browse files
committed
use NonNegativeInteger per spec
1 parent c88ed71 commit f9b94e0

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

server/app/interfaces/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from basyx.aas.adapter.json import StrictStrippedAASFromJsonDecoder, StrictAASFromJsonDecoder, AASToJsonEncoder
2828
from basyx.aas.adapter.xml import xml_serialization, XMLConstructables, read_aas_xml_element
2929
from basyx.aas.model import AbstractObjectStore
30+
from basyx.aas.model.datatypes import NonNegativeInteger
3031
from util.converters import base64url_decode
3132

3233
# The following string aliases are constrained by the decorator functions defined in the string_constraints module,
@@ -213,9 +214,8 @@ def _get_slice(cls, request: Request, iterator: Iterable[T]) -> Tuple[Iterator[T
213214
limit_str = request.args.get('limit', default="10")
214215
cursor_str = request.args.get('cursor', default="1")
215216
try:
216-
limit, cursor = int(limit_str), int(cursor_str) - 1 # cursor is 1-indexed
217-
if limit < 0 or cursor < 0:
218-
raise ValueError
217+
limit, cursor = (NonNegativeInteger(int(limit_str)),
218+
NonNegativeInteger(int(cursor_str) - 1)) # cursor is 1-indexed
219219
except ValueError:
220220
raise BadRequest("Limit can not be negative, cursor must be positive!")
221221
start_index = cursor

server/app/interfaces/repository.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,6 @@
66
# SPDX-License-Identifier: MIT
77
"""
88
This module implements the "Specification of the Asset Administration Shell Part 2 Application Programming Interfaces".
9-
However, several features and routes are currently not supported:
10-
11-
1. Extent Parameter (`withBlobValue/withoutBlobValue`):
12-
Not implemented due to the lack of support in JSON/XML serialization.
13-
14-
2. Route `/shells/{aasIdentifier}/asset-information/thumbnail`: Not implemented because the specification lacks clarity.
15-
16-
3. Serialization and Description Routes:
17-
- `/serialization`
18-
- `/description`
19-
These routes are not implemented at this time.
20-
21-
4. Value, Path, and PATCH Routes:
22-
- All `/…/value$`, `/…/path$`, and `PATCH` routes are currently not implemented.
23-
24-
5. Operation Invocation Routes: The following routes are not implemented because operation invocation
25-
is not yet supported by the `basyx-python-sdk`:
26-
- `POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke`
27-
- `POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke/$value`
28-
- `POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke-async`
29-
- `POST /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/invoke-async/$value`
30-
- `GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/operation-status/{handleId}`
31-
- `GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/operation-results/{handleId}`
32-
- `GET /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/operation-results/{handleId}/$value`
339
"""
3410

3511
import io

0 commit comments

Comments
 (0)