Skip to content

Commit

Permalink
fix(transfer): fixed bug in single api
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Brunkow Moser committed May 13, 2024
1 parent 92d4288 commit 8a3ffa9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

package org.eclipse.tractusx.digitalproductpass.http.controllers.api;

import com.fasterxml.jackson.core.type.TypeReference;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
Expand Down Expand Up @@ -197,8 +198,8 @@ public Response singleApi(@Valid @RequestBody SingleApiRequest singleApiRequestB
Map<String, Object> searchResponseData;
Map<String, Dataset> contracts;
try {
searchResponseData = (Map<String, Object>) jsonUtil.toMap(searchResponse.getData());
contracts = (Map<String, Dataset>) jsonUtil.toMap(searchResponseData.get("contracts"));
searchResponseData = jsonUtil.bind(searchResponse.getData(), new TypeReference<>() {});
contracts = jsonUtil.bind(searchResponseData.get("contracts"), new TypeReference<>() {});
} catch (UtilException e) {
response = httpUtil.getInternalError("Failed to search for digital twin in dtrs: " + e.getMessage());
return httpUtil.buildResponse(response, httpResponse);
Expand Down

0 comments on commit 8a3ffa9

Please sign in to comment.