Skip to content

Commit

Permalink
fix: properly set the referencedItems field in the JSON report
Browse files Browse the repository at this point in the history
See #1515
  • Loading branch information
rdeltour committed Jul 6, 2023
1 parent da643e4 commit 7804c78
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.adobe.epubcheck.opf.OPFChecker30;
import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
import com.google.common.base.Preconditions;

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

private void checkReference(Reference reference)
{
// Report the reference
report.info(reference.location.getPath(), FeatureEnum.RESOURCE, container.relativize(reference.url));

// Retrieve the target resource
Optional<Resource> targetResource = resourceRegistry.getResource(reference.targetResource);
try
Expand Down
8 changes: 8 additions & 0 deletions src/test/resources/reporting/json-report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
Then the JSON report is valid
And JSON at '$.items' contains 5 items
And JSON at '$..checkSum' has no null values

## References

Scenario: cross-HTML references
When checking EPUB 'minimal'
Then the JSON report is valid
And JSON at '$..items[?(@.id=="nav")].referencedItems[0]' is:
| EPUB/content_001.xhtml |

## Layout

Expand Down

0 comments on commit 7804c78

Please sign in to comment.