Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/main/java/org/cyclonedx/model/ReleaseNotes.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public void setProperties(final List<Property> properties) {
}

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public static class Resolves {

public enum Type {
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/org/cyclonedx/BomJsonGeneratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ public void schema12MultipleDependenciesJsonTest() throws Exception {
assertTrue(jsonParser.isValid(file, Version.VERSION_12));
}

@Test
public void schema16ReleaseNotesResolvesWithoutNameJsonTest() throws Exception {
final byte[] bomBytes = Objects.requireNonNull(this.getClass().getResourceAsStream("/1.6/valid-release-notes-1.6.json")).readAllBytes();
final Bom bom = new JsonParser().parse(bomBytes);

BomJsonGenerator generator = BomGeneratorFactory.createJson(Version.VERSION_16, bom);
String json = generator.toJsonString();
assertFalse(json.contains("null"), json);
File file = writeToFile(json);
assertTrue(new JsonParser().isValid(file, Version.VERSION_16));
}

@Test
public void schema13EmptyComponentsJsonTest() throws Exception {
final Bom bom = new Bom();
Expand Down