Skip to content

Commit b855a48

Browse files
committed
Fix failing OSV import
Signed-off-by: nscuro <[email protected]>
1 parent bab5f36 commit b855a48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/dependencytrack/vulndb/source/osv/OsvImporter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.dependencytrack.vulndb.source.osv;
22

3+
import com.fasterxml.jackson.databind.DeserializationFeature;
34
import com.fasterxml.jackson.databind.ObjectMapper;
45
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
56
import com.github.packageurl.MalformedPackageURLException;
@@ -69,6 +70,7 @@ public void init(final Database database) {
6970
this.database = database;
7071
this.httpClient = HttpClient.newHttpClient();
7172
this.objectMapper = new ObjectMapper()
73+
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
7274
.registerModule(new JavaTimeModule());
7375
}
7476

@@ -259,6 +261,9 @@ private void processAdvisory(final OsvAdvisory advisory) {
259261
}
260262
}
261263

264+
// TODO: OSV supports "upstream" IDs that are neither aliases nor related IDs. How to deal with those?
265+
// https://ossf.github.io/osv-schema/#upstream-field
266+
262267
final var vuln = new Vulnerability(
263268
advisory.id(),
264269
advisory.aliases(),

0 commit comments

Comments
 (0)