-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Align CanonicalUri classes #2358
Conversation
src/Hl7.Fhir.Base/Model/Canonical.cs
Outdated
/// <summary> | ||
/// The version string of the canonical (if present). | ||
/// </summary> | ||
public string? Version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> splitCanonical().version
?
/// Constructs a canonical from its components. | ||
/// </summary> | ||
public Canonical(string? uri, string? version, string? anchor) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add Brian's checks here:
if (canonicalUrl == null) throw Error.ArgumentNull(nameof(canonicalUrl));
if (canonicalUrl.IndexOfAny(new[] { '|', '#' }) != -1)
throw Error.Argument(nameof(canonicalUrl), "cannot contain version/fragment data");
if (canonicalVersion != null && canonicalVersion.IndexOfAny(new[] { '|', '#' }) != -1)
throw Error.Argument(nameof(canonicalVersion), "cannot contain version/fragment data");
if (fragment != null && fragment.IndexOfAny(new[] { '|', '#' }) != -1)
throw Error.Argument(nameof(fragment), "already contains version/fragment data");
src/Hl7.Fhir.Base/Model/Canonical.cs
Outdated
/// <summary> | ||
/// Optional anchor at the end of the canonical, without the '#' prefix. | ||
/// </summary> | ||
public string? Anchor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I am calling it Anchor, but it seems Fragment is more popular on The Internet ;-)
@ewoutkramer Wondering why this isn't in https://github.com/FirelyTeam/firely-net-common/blob/develop/src/Hl7.Fhir.Support.Poco/Model/Canonical.cs where it isn't version specific? |
In SDK 5.0, the common repo has been integrated with the main one. So, this is actually the same Canonical you made your PR on! |
fixes #2268