Summary
Two handler methods in server/app/interfaces/repository.py call response_t(…, cursor=cursor), but APIResponse.__init__ accepts paging_metadata: Optional[PagingMetadata], not cursor. This causes a TypeError crash on every request to the affected endpoints, resulting in a 502 Bad Gateway from the WSGI server.
Affected endpoints
GET /shells/{aasIdentifier}/submodel-refs → get_aas_submodel_refs (line ~592)
GET /concept-descriptions → get_concept_description_all (line ~951)
Traceback
File "server/app/interfaces/repository.py", line 592, in get_aas_submodel_refs
return response_t(list(submodel_refs), cursor=cursor)
File "server/app/interfaces/base.py", in __init__
super().__init__(*args, **kwargs, content_type=content_type)
TypeError: Response.__init__() got an unexpected keyword argument 'cursor'
Root cause
_get_slice() returns Tuple[Iterator[T], Optional[PagingMetadata]] (see base.py). The second element is already a PagingMetadata object (or None). The callers incorrectly name the argument cursor= instead of paging_metadata=.
Compare with the correct usage elsewhere in the same file, e.g. get_all_submodels:
paginated_submodels, paging_metadata = self._get_slice(request, submodels)
return response_t(list(paginated_submodels), paging_metadata=paging_metadata, ...)
Fix
# get_aas_submodel_refs (~line 592)
- return response_t(list(submodel_refs), cursor=cursor)
+ return response_t(list(submodel_refs), paging_metadata=cursor)
# get_concept_description_all (~line 951)
- return response_t(list(concept_descriptions), cursor=cursor, stripped=is_stripped_request(request))
+ return response_t(list(concept_descriptions), paging_metadata=cursor, stripped=is_stripped_request(request))
Summary
Two handler methods in
server/app/interfaces/repository.pycallresponse_t(…, cursor=cursor), butAPIResponse.__init__acceptspaging_metadata: Optional[PagingMetadata], notcursor. This causes aTypeErrorcrash on every request to the affected endpoints, resulting in a 502 Bad Gateway from the WSGI server.Affected endpoints
GET /shells/{aasIdentifier}/submodel-refs→get_aas_submodel_refs(line ~592)GET /concept-descriptions→get_concept_description_all(line ~951)Traceback
Root cause
_get_slice()returnsTuple[Iterator[T], Optional[PagingMetadata]](seebase.py). The second element is already aPagingMetadataobject (orNone). The callers incorrectly name the argumentcursor=instead ofpaging_metadata=.Compare with the correct usage elsewhere in the same file, e.g.
get_all_submodels:Fix