Closed aaronzi closed 5 months ago
Hi, my situation is worse. I call PUT /submodels/{submodelIdentifier}/submodel-elements/{idShortPath} (not valueOnly), the httpstatus returned is 404 and the SubmodelElement is removed from the submodel! Even if I'm doing something wrong, the call to update the SubmodelElement should never remove it from the submodel.
BR Manfred
RequestBody: { "modelType": "Property", "value": "Some content", "valueType": "xs:string", "idShort": "String" }
Hi @aaronzi , Hi @mansei ,
Thanks for raising this issue. Could you please update the request body also in your descriptions?
Hi @mdanish98, this is the request I was sending:
curl 'http://localhost:8081/submodels/MWVmYzY0OTktZTQ3NC00Njc5LWJiMmUtNzI5ZWIyOGRjZjgw/submodel-elements/CompanyLogo/$value' \
-X 'PATCH' \
-H 'Accept: */*' \
-H 'Accept-Language: en-US,en' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
-H 'Origin: http://localhost:3000' \
-H 'Referer: http://localhost:3000/' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-site' \
-H 'Sec-GPC: 1' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Brave";v="123", "Not:A-Brand";v="8", "Chromium";v="123"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Windows"' \
--data-raw '"test"'
That's the response I get in the browser:
{
"timestamp": 1711027657561,
"status": 500,
"error": "Internal Server Error",
"path": "/submodels/MWVmYzY0OTktZTQ3NC00Njc5LWJiMmUtNzI5ZWIyOGRjZjgw/submodel-elements/CompanyLogo/$value"
}
The log of the container is already in the original issue message.
Hi @aaronzi ,
Thanks for providing the requested details. The ValueOnly serialization for File SME looks like below: { "contentType": "application/json", "value": "testFile.json" }
So, instead of "test" please try with the above serialization.
Thank you, you are right. This works.
But as @mansei also mentioned, the PUT-request has an issue. This is my request for example:
curl -X 'PUT' \
'http://localhost:8081/submodels/MWVmYzY0OTktZTQ3NC00Njc5LWJiMmUtNzI5ZWIyOGRjZjgw/submodel-elements/CompanyLogo?level=deep' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"modelType": "File",
"contentType": "application/json",
"value": "demo.json",
"semanticId": {
"keys": [
{
"type": "GlobalReference",
"value": "https://admin-shell.io/zvei/nameplate/2/0/Nameplate/CompanyLogo "
}
],
"type": "ExternalReference"
},
"qualifiers": [
{
"kind": "ConceptQualifier",
"type": "Multiplicity",
"value": "ZeroToOne",
"valueType": "xs:string"
}
],
"idShort": "CompanyLogo"
}'
When executing this I get a 404 error and the property gets removed entirely.
We are analyzing this issue, and we'll get back to you with the analysis results.
The fix will be included in the next SNAPSHOT release.
After switching to the image tag milestone_02 of the AAS Environment I am not able to update the value of file SubmodelElements anymore. The AAS Env will return an internal server error with error code 500 (see log). Also updating the file SubmodelElement with
PUT /submodels/{submodelIdentifier}/submodel-elements/{idShortPath}
is throwing an internal server error.