Skip to content

Sequence extension - type string and lexicographical order #1151

@black-snow

Description

@black-snow

I was stumbling over some issue when I evaluated if sequence was the right field for revisioning my payloads.

The sequence extension requires for sequence:

MUST be a non-empty lexicographically-orderable string

But then:

RECOMMENDED as monotonically increasing and contiguous

contiguous seems kinda fuzzy when looking at strings. And worse, the only given sequencetype is an (for some reason) unsigned 32-bit int, which

MUST start with a value of 1 and increase by 1 for each subsequent value

But if we simply turn our numbers into strings like "1", "2", ... and 10 the lexicographical order would (arguably) be 1, 10, 2, which is not what we want. We'd have to zero left-pad everything like 01, 02, 10, ... but then we'd have to zero-pad to the full legth (always 10 characters in total).

So is sequence required to be orderable but we'll just ignore the lexicographical order when sequencetype == Integer because it makes no sense?


What if sequence was of type string|number and just guaranteed a total order?
Why do we waste half of the space with a signed int? (Who'd use negative seq values, especially if the seq must start at 1?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions