fix: prioritize special package handlers over meta.source fallback in getPath()#1276
Open
JorisHeadease wants to merge 1 commit intoHL7:masterfrom
Open
fix: prioritize special package handlers over meta.source fallback in getPath()#1276JorisHeadease wants to merge 1 commit intoHL7:masterfrom
JorisHeadease wants to merge 1 commit intoHL7:masterfrom
Conversation
Move the meta.source (def) fallback in getPath() to after the special package type handlers (Simplifier, VSAC, DICOM, PhinVads, etc.). These handlers are purpose-built to generate correct web URLs for their respective package types. Previously, a non-null meta.source value would short-circuit these handlers, returning a provenance URI as a web hyperlink. This produced broken links for any package that lacks spec.internals and has meta.source set (e.g. Simplifier-published packages like nictiz.fhir.nl.r4.zib2020). meta.source is retained as a last-resort fallback after the special handlers, in case no handler matches. Fixes HL7#1275
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
SpecMapManager.getPath()usesmeta.source(passed as thedefparameter) as a web hyperlink for resources from dependency packages before the special package type handlers (Simplifier, VSAC, DICOM, etc.) are reached.meta.sourceis a provenance URI per the FHIR spec — not a navigable web URL. The special package handlers exist specifically to generate correct links for their respective package types, but are never invoked whenmeta.sourceis non-null.Call sites passing
meta.sourceasdefgetResourcePath()PublisherLoader.javagetIgPath()PublisherLoader.javagetCorePath()LoaderUtils.javaAll pass
resource.getMeta().getSource()as thedefparameter.Fallback order before this fix
Fallback order after this fix
Impact
For Simplifier-published packages (e.g.
nictiz.fhir.nl.r4.zib2020) that lackspec.internalsand havemeta.sourceset, this produces broken hyperlinks in the generated IG HTML.Before: Link points to
http://decor.nictiz.nl/fhir/4.0/zib2020bbr-(truncatedmeta.sourceprovenance URI)After: Link points to
https://simplifier.net/resolve?scope=nictiz.fhir.nl.r4.zib2020@0.12.0-beta.4&canonical=...(correct Simplifier redirect)A reproduction project is attached to #1275.
Fixes #1275