Parsing ISO 8601 compliant metadata.timestamp returns null in bom
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with org.cyclonedx.parsers.JsonParser and the BomParserTest reproduction, using src/test/resources/bom.json from the attached TestSbomImport. Compare parsing behavior after 9.1.0 and verify that an ISO 8601 metadata.timestamp produces a non-null Bom metadata timestamp; keep the regression test passing.
Written by the indexing model from the issue text.
Description
Parsing a bom with ISO 8601 compliant available metadata.timestamp using a version > 9.1.0 returns a bom object with value null
for metadata.timestamp.
Code to reproduce the behaviour (or run the test in BomParserTest in attached TestSbomImport):
import org.cyclonedx.model.Bom;
import org.cyclonedx.parsers.JsonParser;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
public class BomParserTest {
@Test
void manTest() {
try {
String bomContent = new String(Files.readAllBytes(new File("src/test/resources/bom.json").toPath()));
Bom b = new JsonParser().parse(bomContent.getBytes(StandardCharsets.UTF_8));
// works with 9.1.0 but not with later versions
assertNotNull(b.getMetadata().getTimestamp());
}
catch (Exception e) {
assertNull(e);
}
}
}
- Dominant language
- Java
- Stars
- 120
- Forks
- 91
- Avg merge
- 10h 17m
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CycloneDX/cyclonedx-core-java
-
breaking change
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CycloneDX/cyclonedx-core-java#917 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CycloneDX/cyclonedx-core-java#819 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
CycloneDX/cyclonedx-core-java#942 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
CycloneDX/cyclonedx-core-java#938 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
CycloneDX/cyclonedx-core-java#902 ·
All issues in CycloneDX/cyclonedx-core-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100