Skip to content

Commit

Permalink
Merge pull request #74 from spdx/issue73
Browse files Browse the repository at this point in the history
Generate a warning if attempting to serialize SPDX V3 data
  • Loading branch information
goneall authored Oct 12, 2024
2 parents 0b10246 + 251ab7a commit 55333e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/spdx/jacksonstore/MultiFormatStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ public synchronized void serialize(OutputStream stream, @Nullable CoreModelObjec
List<String> allDocuments = getAllItems(null, SpdxConstantsCompatV2.CLASS_SPDX_DOCUMENT)
.map(tv -> tv.getObjectUri().substring(0, tv.getObjectUri().indexOf('#')))
.collect(Collectors.toList());
if (allDocuments.isEmpty()) {
logger.warn("No SPDX Spec Version 2 Documents were found to serialize. Note: For SPDX Spec version 3, the spdx-v3jsonld-store should be used");
}
output = allDocuments.size() == 1 ? serializer.docToJsonNode(allDocuments.get(0)) :
serializer.docsToJsonNode(allDocuments);
}
Expand Down

0 comments on commit 55333e8

Please sign in to comment.