Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a warning if attempting to serialize SPDX V3 data #74

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading