Skip to content

Commit dfb9b85

Browse files
committed
Add journey id to the wide event schema
1 parent f626599 commit dfb9b85

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

schemas/wide_event_schema.json5

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@
336336
"additionalProperties": { "const": false },
337337
"properties": {
338338
"type": "object",
339-
"required": ["name"],
339+
"required": ["name", "id"],
340340
"properties": {
341-
"name": { "$ref": "#/$defs/stringEnumProperty" }
341+
"name": { "$ref": "#/$defs/stringEnumProperty" },
342+
"id": { "$ref": "#/$defs/stringValueWithPatternProperty" }
342343
},
343344
"additionalProperties": false
344345
}

tests/pixel_definition_validation_test.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,7 @@ describe('Wide Event journey section handling', () => {
14431443
},
14441444
journey: {
14451445
name: { type: 'string', description: 'Journey name' },
1446+
id: { type: 'string', description: 'Journey id', pattern: '^[0-9a-f]{32}$' },
14461447
},
14471448
};
14481449

@@ -1465,7 +1466,7 @@ describe('Wide Event journey section handling', () => {
14651466
const generated = generatedSchemas.w_with_journey;
14661467
expect(generated.properties).to.have.property('journey');
14671468
expect(generated.required).to.include('journey');
1468-
expect(generated.properties.journey.required).to.deep.equal(['name']);
1469+
expect(generated.properties.journey.required).to.deep.equal(['name', 'id']);
14691470
expect(generated.properties.journey.properties.name.enum).to.deep.equal(['first_run', 'returning_user']);
14701471
});
14711472

0 commit comments

Comments
 (0)