Skip to content

Commit

Permalink
entity: add comment explaining UUID regex (#1169)
Browse files Browse the repository at this point in the history
Per https://getodk.github.io/xforms-spec/entities.html#declaring-that-a-form-creates-entities:

> MUST have attribute id populated by a RFC 4122 version 4 UUID
  • Loading branch information
alxndrsn authored Aug 15, 2024
1 parent fb96aa3 commit eeb0e43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/data/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const odataToColumnMap = new Map([
['__system/conflict', 'entities.conflict']
]);

// Entity IDs must be UUID v4. See: https://getodk.github.io/xforms-spec/entities.html#declaring-that-a-form-creates-entities
const _uuidPattern = /^(uuid:)?([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$/i;

////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit eeb0e43

Please sign in to comment.