Skip to content

Commit 704f9da

Browse files
authored
Fetch artifact type from artifact metadata in the compatibility api (#3054)
1 parent 6bb4599 commit 704f9da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/io/apicurio/registry/ccompat/store/RegistryStorageFacadeImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ public SchemaInfo getSchemaById(int contentId) throws ArtifactNotFoundException,
168168
public Schema getSchema(String subject, String versionString) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException {
169169
return parseVersionString(subject, versionString,
170170
version -> {
171-
if (ArtifactState.DISABLED.equals(storage.getArtifactVersionMetaData(null, subject, version).getState())) {
171+
ArtifactVersionMetaDataDto artifactVersionMetaDataDto = storage.getArtifactVersionMetaData(null, subject, version);
172+
if (ArtifactState.DISABLED.equals(artifactVersionMetaDataDto.getState())) {
172173
throw new VersionNotFoundException(null, subject, version);
173174
}
174175
StoredArtifactDto storedArtifact = storage.getArtifactVersion(null, subject, version);
175-
Map<String, ContentHandle> resolvedReferences = storage.resolveReferences(storedArtifact.getReferences());
176-
return converter.convert(subject, storedArtifact, ArtifactTypeUtil.determineArtifactType(storedArtifact.getContent(), null, null, resolvedReferences, factory.getAllArtifactTypes()));
176+
return converter.convert(subject, storedArtifact, artifactVersionMetaDataDto.getType());
177177
});
178178
}
179179

0 commit comments

Comments
 (0)