Skip to content

Commit 2f79d71

Browse files
authored
feat(schema): add description field to regiondefinition.json @W-22617900 (#536)
1 parent b6d2879 commit 2f79d71

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@salesforce/b2c-tooling-sdk': minor
3+
---
4+
5+
Add optional `description` field to `regiondefinition.json` schema, matching the field added to the ECOM platform schema in W-22617900.

packages/b2c-tooling-sdk/data/content-schemas/regiondefinition.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"properties": {
77
"id": {"$ref":"common.json#/definitions/id"},
88
"name": {"$ref":"common.json#/definitions/name"},
9+
"description": {"$ref":"common.json#/definitions/description"},
910
"max_components": {
1011
"type": "integer",
1112
"minimum": 1

packages/b2c-tooling-sdk/test/operations/content/validate.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,28 @@ describe('content metadefinition validation', () => {
341341
);
342342
expect(result.valid).to.equal(true);
343343
});
344+
345+
it('passes when region definition includes a description', () => {
346+
const result = validateMetaDefinition(
347+
{
348+
group: 'content',
349+
region_definitions: [{id: 'main', name: 'Main', description: 'The main content region'}],
350+
attribute_definition_groups: [],
351+
},
352+
{type: 'componenttype'},
353+
);
354+
expect(result.valid).to.equal(true);
355+
});
356+
357+
it('passes when pagetype region definition includes a description', () => {
358+
const result = validateMetaDefinition(
359+
{
360+
region_definitions: [{id: 'hero', name: 'Hero', description: 'Top hero region'}],
361+
},
362+
{type: 'pagetype'},
363+
);
364+
expect(result.valid).to.equal(true);
365+
});
344366
});
345367

346368
describe('error message formatting', () => {

0 commit comments

Comments
 (0)