From e1610daf82f67b075128079e2f7cd06dc7b5f811 Mon Sep 17 00:00:00 2001 From: mateusmolina Date: Mon, 4 Nov 2024 16:13:29 +0100 Subject: [PATCH] fix: submodel metadata deser. mismatch 2 --- .../client/internal/SubmodelRepositoryApi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basyx.submodelrepository/basyx.submodelrepository-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/client/internal/SubmodelRepositoryApi.java b/basyx.submodelrepository/basyx.submodelrepository-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/client/internal/SubmodelRepositoryApi.java index 07b0466fc..c82cadd29 100644 --- a/basyx.submodelrepository/basyx.submodelrepository-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/client/internal/SubmodelRepositoryApi.java +++ b/basyx.submodelrepository/basyx.submodelrepository-client/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/client/internal/SubmodelRepositoryApi.java @@ -301,10 +301,10 @@ public ApiResponse getSubmodelByIdMetadataWithHttpInfoNoUrlEncoding(St Submodel deserializedSubmodel = localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() { }); - if (deserializedSubmodel != null && deserializedSubmodel.getSubmodelElements() == null) - deserializedSubmodel.setSubmodelElements(Collections.emptyList()); + if (deserializedSubmodel != null && deserializedSubmodel.getSubmodelElements() != null && deserializedSubmodel.getSubmodelElements().isEmpty()) + deserializedSubmodel.setSubmodelElements(null); - return new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), deserializedSubmodel); + return new ApiResponse<>(localVarResponse.statusCode(), localVarResponse.headers().map(), deserializedSubmodel); } finally { } } catch (IOException e) {