transparency-exchange-api icon indicating copy to clipboard operation
transparency-exchange-api copied to clipboard

`date-format` used in OpenAPI Spec is not high enough resolution

Open madpah opened this issue 6 months ago • 1 comments

createdBy is used for sorting, but the format specified is:

    date-time:
      type: string
      description: Timestamp
      format: date-time
      pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
      example: '2024-03-20T15:30:00Z'

This has a resolution of seconds. Multiple releases are definitely possible in a single second - so this would mean ordering is not accurate in all scenarios.

FYI @nscuro @oej

madpah avatar May 28 '25 14:05 madpah

Alternatively, requiring implementations to ensure stable ordering might be an option. The way you'd typically solve this is via a separate, potentially internal sequence, like an incrementing integer as typically used in RDBMSes. So you'd internally sort by createdBy, sequenceNo.

nscuro avatar May 28 '25 15:05 nscuro