Skip to content

Commit c52eb30

Browse files
ccompat contentId fetch no orphan check (#4244)
* ccompat contentId fetch no orphan check * remove now unused import --------- Co-authored-by: Carles Arnal <carlesarnal92@gmail.com>
1 parent ac0f9d9 commit c52eb30

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

app/src/main/java/io/apicurio/registry/ccompat/rest/v7/impl/SchemasResourceImpl.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import io.apicurio.registry.storage.dto.ArtifactReferenceDto;
1515
import io.apicurio.registry.storage.dto.ContentWrapperDto;
1616
import io.apicurio.registry.storage.dto.StoredArtifactDto;
17-
import io.apicurio.registry.storage.error.ArtifactNotFoundException;
1817
import io.apicurio.registry.types.ArtifactType;
1918
import io.apicurio.registry.util.ArtifactTypeUtil;
2019
import jakarta.interceptor.Interceptors;
@@ -41,13 +40,8 @@ public SchemaInfo getSchema(int id, String subject, String groupId) {
4140
references = artifactVersion.getReferences();
4241
} else {
4342
ContentWrapperDto contentWrapper = storage.getArtifactByContentId(id);
44-
contentHandle = storage.getArtifactByContentId(id).getContent();
43+
contentHandle = contentWrapper.getContent();
4544
references = contentWrapper.getReferences();
46-
List<ArtifactMetaDataDto> artifacts = storage.getArtifactVersionsByContentId(id);
47-
if (artifacts == null || artifacts.isEmpty()) {
48-
//the contentId points to an orphaned content
49-
throw new ArtifactNotFoundException("ContentId: " + id);
50-
}
5145
}
5246
return converter.convert(contentHandle, ArtifactTypeUtil.determineArtifactType(contentHandle, null, null, storage.resolveReferences(references), factory.getAllArtifactTypes()), references);
5347
}

0 commit comments

Comments
 (0)