Skip to content

Qualifiers Ordering #53

@tommyknows

Description

@tommyknows

Hi again!

After #52, there seems to be a "bug" about the ordering of the qualifiers.
The code says:

// Qualifiers is a slice of key=value pairs, with order preserved as it appears
// in the package URL.

However, with the switch to the url.URL type, when encoding the qualifiers they actually get ordered lexicographically.

Now I've started to wonder what the "correct" behaviour for this is. The PURL Spec even says:

If the qualifiers are not empty and not composed only of key/value pairs where the value is empty:
...

  • sort this list of qualifier strings lexicographically
    ...

So admittedly, according to the spec, the "new" behaviour is correct.
Should I submit a PR to remove the comment that the order is being preserved? I'm wondering if this should be considered a breaking change.

Or do you have an opinion / better idea on what to do here?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions