From 521aa6c749cd24e325014e30862aeb80411ebda6 Mon Sep 17 00:00:00 2001 From: msm1992 Date: Tue, 3 Sep 2024 14:31:58 +0530 Subject: [PATCH] Fix API Update Issue --- .../apimgt/persistence/RegistryPersistenceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java index f3a83f589b87..3d49b9c429cd 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java @@ -607,6 +607,15 @@ public PublisherAPI updateAPI(Organization org, PublisherAPI publisherAPI) throw for (String docPath : docsPaths) { if (!(docPath.equalsIgnoreCase(pathToContent) || docPath.equalsIgnoreCase(pathToDocFile))) { Resource docResource = registry.get(docPath); + if (docResource instanceof org.wso2.carbon.registry.core.Collection) { + //This is a custom folder and will be ignored. + continue; + } else if (docResource != null) { + if (!APIConstants.DOCUMENT_RXT_MEDIA_TYPE.equals(docResource.getMediaType())) { + //These are custom resources and will be ignored. + continue; + } + } GenericArtifactManager docArtifactManager = RegistryPersistenceDocUtil .getDocumentArtifactManager(registry); GenericArtifact docArtifact = docArtifactManager.getGenericArtifact(docResource.getUUID());