|
52 | 52 | import org.opensearch.common.inject.Inject;
|
53 | 53 | import org.opensearch.common.settings.Settings;
|
54 | 54 | import org.opensearch.common.util.concurrent.ThreadContext;
|
| 55 | +import org.opensearch.common.xcontent.XContentHelper; |
| 56 | +import org.opensearch.common.xcontent.json.JsonXContent; |
55 | 57 | import org.opensearch.commons.authuser.User;
|
56 | 58 | import org.opensearch.core.action.ActionListener;
|
57 | 59 | import org.opensearch.core.rest.RestStatus;
|
|
68 | 70 | import org.opensearch.ml.common.transport.model.MLModelDeleteAction;
|
69 | 71 | import org.opensearch.ml.common.transport.model.MLModelDeleteRequest;
|
70 | 72 | import org.opensearch.ml.common.transport.model.MLModelGetRequest;
|
71 |
| -import org.opensearch.ml.common.utils.StringUtils; |
72 | 73 | import org.opensearch.ml.engine.utils.AgentModelsSearcher;
|
73 | 74 | import org.opensearch.ml.helper.ModelAccessControlHelper;
|
74 | 75 | import org.opensearch.ml.utils.RestActionUtils;
|
@@ -305,7 +306,7 @@ private void checkPipelineBeforeDeleteModel(
|
305 | 306 | ) {
|
306 | 307 | ActionRequest request = requestSupplier.get();
|
307 | 308 | client.execute(actionType, request, ActionListener.wrap(pipelineResponse -> {
|
308 |
| - Map<String, Object> allConfigMap = StringUtils.fromJson(pipelineResponse.toString(), ""); |
| 309 | + Map<String, Object> allConfigMap = XContentHelper.convertToMap(JsonXContent.jsonXContent, pipelineResponse.toString(), true); |
309 | 310 | List<String> allDependentPipelineIds = findDependentPipelinesEasy(allConfigMap, modelId);
|
310 | 311 | if (allDependentPipelineIds.isEmpty()) {
|
311 | 312 | actionListener.onResponse(true);
|
|
0 commit comments