Stream: implementers
Topic: Relative Canonical URLs
James Agnew (Oct 15 2021 at 20:38):
Question about the Canonical datatype: Is it valid to put a relative URL in an element of type canonical?
There are a few places in the spec where it just makes sense to have local references between resources in a place that uses a canonical, e.g. PlanDefinition.definitionCanonical
. The relevant bit of the spec on resolving canonical references states that the server should then fall back to direct resolution using the URL as a literal reference if a local version of the canonical resource cannot be found
which implies to me that any literal reference is ok, including a relative one.
Lloyd McKenzie (Oct 15 2021 at 20:40):
No. Canonicals must be absolute.
Lloyd McKenzie (Oct 15 2021 at 20:41):
(Though they don't need to resolve)
James Agnew (Oct 15 2021 at 20:43):
Having an unresolvable absolute URL seems infinitely less useful to me than a resolvable local reference. Is this a good rule?
Lloyd McKenzie (Oct 15 2021 at 20:45):
Yes - because canonicals need to match the "url" element on the thing you're referencing - and there's no "local" context for that.
Grahame Grieve (Oct 15 2021 at 20:48):
No. Canonicals must be absolute
no
Lloyd McKenzie (Oct 15 2021 at 20:48):
They can be #123
Lloyd McKenzie (Oct 15 2021 at 20:48):
(to a contained resource)
Grahame Grieve (Oct 15 2021 at 20:49):
yes. https://hl7.org/fhir/references.html#canonical-fragments
Lloyd McKenzie (Oct 15 2021 at 20:50):
But you can't have a canonical that says "Questionnaire/123", right?
Grahame Grieve (Oct 15 2021 at 20:50):
right
James Agnew (Oct 15 2021 at 20:56):
hmm ok
Last updated: Apr 12 2022 at 19:14 UTC