transparency-exchange-api
transparency-exchange-api copied to clipboard
`date-format` used in OpenAPI Spec is not high enough resolution
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
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.