Skip to content

Commit b945213

Browse files
authored
Merge pull request #310 from mgoodnow/DCAT-2691-mgoodnow-layer
DCAT-2691: Adding CCDM product layer REST API documentation
2 parents 95581e9 + a214c38 commit b945213

File tree

1 file changed

+224
-1
lines changed

1 file changed

+224
-1
lines changed

static/rest/data-ingestion-schema-v1.yaml

Lines changed: 224 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ paths:
12401240
- Products
12411241
summary: Delete products
12421242
description: >
1243-
Delete products with specified `sku`` and `source`` values
1243+
Delete products with specified `sku` and `source` values
12441244
operationId: deleteProducts
12451245
parameters:
12461246
- $ref: "#/components/parameters/Authorization"
@@ -1276,6 +1276,133 @@ paths:
12761276
"source": { "locale": "en-US" }
12771277
}
12781278
]
1279+
/v1/catalog/products/layers:
1280+
post:
1281+
tags:
1282+
- Product Layers
1283+
summary: Create or replace product layers
1284+
description: |
1285+
You can create a product layer to merge and override a base product.
1286+
1287+
When creating product layers:
1288+
- Each product layer requires a SKU identifier which matches to a base product.
1289+
- A product layer may have a defined catalog `source.locale`, and if absent is treated as a global layer for any locale.
1290+
- A product layer must have a defined catalog `source.layer`.
1291+
- All other fields are optional. If provided, they are used to override the base product.
1292+
- When merging array lists, the first array is merged with the base list. All other inner lists of the same object are treated as replace values.
1293+
For example `attributes` is merged with base list, but `attributes.values` is a replacement.
1294+
<pre>
1295+
{
1296+
"sku": "pants-red-32",
1297+
"source": {
1298+
"locale": "en",
1299+
"layer": "custom-layer"
1300+
},
1301+
"attributes": [
1302+
{
1303+
"code": "color",
1304+
"values": ["Green", "Light Green"],
1305+
"variantReferenceId": "pants-color-green"
1306+
}
1307+
]
1308+
}
1309+
</pre>
1310+
1311+
operationId: createProductLayers
1312+
parameters:
1313+
- $ref: "#/components/parameters/Authorization"
1314+
- $ref: "#/components/parameters/ContentType"
1315+
- $ref: "#/components/parameters/ContentEncoding"
1316+
responses:
1317+
"200":
1318+
$ref: "#/components/responses/AcceptedResponse"
1319+
"400":
1320+
$ref: "#/components/responses/InvalidItemsResponse"
1321+
"401":
1322+
$ref: "#/components/responses/UnauthorizedResponse"
1323+
"403":
1324+
$ref: "#/components/responses/ForbiddenResponse"
1325+
"429":
1326+
$ref: "#/components/responses/TooManyRequestsResponse"
1327+
requestBody:
1328+
content:
1329+
application/json:
1330+
schema:
1331+
type: array
1332+
items:
1333+
$ref: "#/components/schemas/FeedProductLayer"
1334+
examples:
1335+
ProductLayerWithImages:
1336+
summary: Create a product layer
1337+
description: >
1338+
Create a product layer with changes.
1339+
value:
1340+
[
1341+
{
1342+
"sku": "red-pants",
1343+
"source": {
1344+
"locale": "en-US",
1345+
"layer": "custom-layer"
1346+
},
1347+
"name": "red pants for my custom layer",
1348+
"description": "long description about red pants for my custom layer",
1349+
"shortDescription": "just pants for custom layer",
1350+
"images":
1351+
[
1352+
{
1353+
"url": "https://example.com/images/pants.jpg",
1354+
"label": "photo of my pants for my custom layer",
1355+
"roles": ["BASE", "SMALL"],
1356+
"customRoles": ["widget"]
1357+
}
1358+
]
1359+
}
1360+
]
1361+
/v1/catalog/products/layers/delete:
1362+
post:
1363+
tags:
1364+
- Product Layers
1365+
summary: Delete product layers
1366+
description: >
1367+
Delete product layers with specified `sku` and `source` values
1368+
operationId: deleteProductLayers
1369+
parameters:
1370+
- $ref: "#/components/parameters/Authorization"
1371+
- $ref: "#/components/parameters/ContentType"
1372+
- $ref: "#/components/parameters/ContentEncoding"
1373+
responses:
1374+
"200":
1375+
$ref: "#/components/responses/AcceptedResponse"
1376+
"400":
1377+
$ref: "#/components/responses/InvalidItemsResponse"
1378+
"401":
1379+
$ref: "#/components/responses/UnauthorizedResponse"
1380+
"403":
1381+
$ref: "#/components/responses/ForbiddenResponse"
1382+
"429":
1383+
$ref: "#/components/responses/TooManyRequestsResponse"
1384+
requestBody:
1385+
content:
1386+
application/json:
1387+
schema:
1388+
type: array
1389+
items:
1390+
$ref: "#/components/schemas/FeedProductLayerDelete"
1391+
examples:
1392+
DeleteSimpleProduct:
1393+
summary: Delete product layer
1394+
description: >
1395+
Delete a product layer with specified `sku` and `source` values
1396+
value:
1397+
[
1398+
{
1399+
"sku": "red-pants",
1400+
"source": {
1401+
"locale": "en-US",
1402+
"layer": "custom-layer"
1403+
}
1404+
}
1405+
]
12791406
/v1/catalog/price-books:
12801407
post:
12811408
tags:
@@ -2478,6 +2605,87 @@ components:
24782605
example: MH01
24792606
source:
24802607
$ref: "#/components/schemas/Source"
2608+
FeedProductLayer:
2609+
title: Catalog Product Layer payload
2610+
type: object
2611+
required:
2612+
- sku
2613+
- source
2614+
properties:
2615+
sku:
2616+
type: string
2617+
description: SKU (Stock Keeping Unit) is a unique identifier for a product.
2618+
example: MH01
2619+
source:
2620+
$ref: "#/components/schemas/SourceLayer"
2621+
name:
2622+
type: string
2623+
description: Product name
2624+
example: Kangaroo Hoodie
2625+
slug:
2626+
type: string
2627+
description: The URL key for the product.
2628+
example: kangaroo-hoodie.html
2629+
description:
2630+
type: string
2631+
nullable: true
2632+
description: The main description for the product
2633+
example: A kangaroo hoodie for all seasons
2634+
shortDescription:
2635+
type: string
2636+
nullable: true
2637+
description: A short description of the product
2638+
example: A hoodie for all seasons with a kangaroo pocket
2639+
metaTags:
2640+
$ref: "#/components/schemas/ProductMetaAttribute"
2641+
attributes:
2642+
type: array
2643+
description: A list of product attributes.
2644+
items:
2645+
$ref: "#/components/schemas/ProductAttribute"
2646+
images:
2647+
type: array
2648+
description: A list of product images.
2649+
items:
2650+
$ref: "#/components/schemas/ProductImage"
2651+
links:
2652+
type: array
2653+
description: A list of linked SKUs.
2654+
items:
2655+
$ref: "#/components/schemas/ProductLink"
2656+
routes:
2657+
type: array
2658+
description: A list of product routes.
2659+
items:
2660+
$ref: "#/components/schemas/ProductRoutes"
2661+
configurations:
2662+
type: array
2663+
description: Composite products, such as configurable products, must provide a list of product options that a shopper can select (for example, "color", "size", etc.).
2664+
items:
2665+
$ref: "#/components/schemas/ProductConfiguration"
2666+
bundles:
2667+
type: array
2668+
description: Composite products, such as bundle products, must include a list of individual products that are part of the bundle, organized into groups (for example, "shirts", "pants", "accessories").
2669+
items:
2670+
$ref: "#/components/schemas/ProductBundle"
2671+
externalIds:
2672+
type: array
2673+
description: A list of external IDs for the product.
2674+
items:
2675+
$ref: "#/components/schemas/ProductExternalId"
2676+
FeedProductLayerDelete:
2677+
title: Catalog Product Layer delete payload
2678+
type: object
2679+
required:
2680+
- sku
2681+
- source
2682+
properties:
2683+
sku:
2684+
type: string
2685+
description: Product unique identifier
2686+
example: MH01
2687+
source:
2688+
$ref: "#/components/schemas/SourceLayer"
24812689
FeedPricebook:
24822690
title: FeedPricebook
24832691
description: |
@@ -2762,6 +2970,21 @@ components:
27622970
type: string
27632971
description: A single value that represents content locale, for example, English.
27642972
example: English
2973+
SourceLayer:
2974+
title: Catalog layer source
2975+
description: Source of the entity, for example, "en-US" for US English for layer "MyLayer"
2976+
type: object
2977+
required:
2978+
- layer
2979+
properties:
2980+
locale:
2981+
type: string
2982+
description: A single value that represents content locale. When absent layer is treated as global for any locale.
2983+
example: English
2984+
layer:
2985+
type: string
2986+
description: A single value that represents content layer.
2987+
example: MyLayer
27652988
ProductMetaAttribute:
27662989
title: Meta Attributes
27672990
description: Meta attributes that are specified in <meta> tags.

0 commit comments

Comments
 (0)