Skip to content

Commit 7804c78

Browse files
committed
fix: properly set the referencedItems field in the JSON report
See #1515
1 parent da643e4 commit 7804c78

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/main/java/org/w3c/epubcheck/core/references/ResourceReferencesChecker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.adobe.epubcheck.opf.OPFChecker30;
4444
import com.adobe.epubcheck.opf.ValidationContext;
4545
import com.adobe.epubcheck.util.EPUBVersion;
46+
import com.adobe.epubcheck.util.FeatureEnum;
4647
import com.google.common.base.Preconditions;
4748

4849
import io.mola.galimatias.URL;
@@ -108,6 +109,9 @@ public void check()
108109

109110
private void checkReference(Reference reference)
110111
{
112+
// Report the reference
113+
report.info(reference.location.getPath(), FeatureEnum.RESOURCE, container.relativize(reference.url));
114+
111115
// Retrieve the target resource
112116
Optional<Resource> targetResource = resourceRegistry.getResource(reference.targetResource);
113117
try

src/test/resources/reporting/json-report.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
Then the JSON report is valid
1414
And JSON at '$.items' contains 5 items
1515
And JSON at '$..checkSum' has no null values
16+
17+
## References
18+
19+
Scenario: cross-HTML references
20+
When checking EPUB 'minimal'
21+
Then the JSON report is valid
22+
And JSON at '$..items[?(@.id=="nav")].referencedItems[0]' is:
23+
| EPUB/content_001.xhtml |
1624

1725
## Layout
1826

0 commit comments

Comments
 (0)