Skip to content

Commit

Permalink
chore: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Aug 5, 2024
1 parent a8168be commit 3d82da6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.eclipse.edc.catalog.api.query;

import com.fasterxml.jackson.databind.DeserializationFeature;
import org.eclipse.edc.catalog.spi.QueryService;
import org.eclipse.edc.jsonld.spi.JsonLd;
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
Expand All @@ -32,6 +33,7 @@
import org.eclipse.edc.web.spi.WebService;

import java.io.IOException;
import java.util.stream.Stream;

import static org.eclipse.edc.catalog.spi.FccApiContexts.CATALOG_QUERY;
import static org.eclipse.edc.jsonld.spi.Namespaces.DCAT_PREFIX;
Expand Down Expand Up @@ -103,8 +105,10 @@ private void registerVersionInfo(ClassLoader resourceClassLoader) {
if (versionContent == null) {
throw new EdcException("Version file not found or not readable.");
}
var content = typeManager.getMapper().readValue(versionContent, VersionRecord.class);
apiVersionService.addRecord(CATALOG_QUERY, content);
Stream.of(typeManager.getMapper()
.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
.readValue(versionContent, VersionRecord[].class))
.forEach(vr -> apiVersionService.addRecord(CATALOG_QUERY, vr));
} catch (IOException e) {
throw new EdcException(e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"version": "1.0.0-alpha",
"urlPath": "/v1alpha",
"lastUpdated": "2024-06-19T11:00:00Z"
}
[
{
"version": "1.0.0-alpha",
"urlPath": "/v1alpha",
"lastUpdated": "2024-06-19T11:00:00Z"
}
]
2 changes: 1 addition & 1 deletion resources/openapi/catalog-api.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
extensions/api/federated-catalog-api/src/main/resources/fc-api-version.json
extensions/api/federated-catalog-api/src/main/resources/catalog-version.json

0 comments on commit 3d82da6

Please sign in to comment.