Subsequent calls then throw an exception. Besides, the object should not be changed during the reading operation. You would rather need to copy the data except for the submodel elements.
java.lang.NullPointerException: Cannot invoke "java.util.List.stream()" because "allSubmodels" is null
To Reproduce
Steps to reproduce the behavior:
Set up the submodel service
GET /submodel/$metadata
GET /submodel/submodel-elements
=>Exception occurs:
{
"timestamp": 1726556325622,
"status": 500,
"error": "Internal Server Error",
"path": "/submodel/submodel-elements"
}
Expected behavior
We should rather copy the object - at least for the in-memory solution - but not alter the object on a GET-operation.
BaSyx (please complete the following information):
BaSyx Version [v2.0]
BaSyx SDK [Java]
AAS Version [DotAAS V3]
System (please complete the following information):
Describe the bug
When reading the metadata of the submodel-service submodel, the in-memory object is changed by setting the list of all submodel elements to null.
Subsequent calls then throw an exception. Besides, the object should not be changed during the reading operation. You would rather need to copy the data except for the submodel elements.
To Reproduce Steps to reproduce the behavior:
Expected behavior
We should rather copy the object - at least for the in-memory solution - but not alter the object on a GET-operation.
BaSyx (please complete the following information):
System (please complete the following information):