Skip to content
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

Merged
merged 4 commits into from
Jan 10, 2023
Merged

Conversation

mmsmits
Copy link
Member

@mmsmits mmsmits commented Jan 6, 2023

fixes #2268

/// <summary>
/// The version string of the canonical (if present).
/// </summary>
public string? Version
Copy link
Member

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)
{
Copy link
Member

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");

/// <summary>
/// Optional anchor at the end of the canonical, without the '#' prefix.
/// </summary>
public string? Anchor
Copy link
Member

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 ewoutkramer merged commit 8c50283 into release/5.0.0 Jan 10, 2023
@ewoutkramer ewoutkramer deleted the feature/allign-canonical-classes branch January 10, 2023 15:25
@brianpos
Copy link
Collaborator

@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?

@ewoutkramer
Copy link
Member

@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!

@ewoutkramer ewoutkramer changed the title Allign CanonicalUri classes Align CanonicalUri classes Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants