Add example showing how to handle null attributes
This commit is contained in:
parent
9b00a42d5d
commit
c21f8f9e34
@ -43,13 +43,41 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProductPayloadListResponse'
|
||||
examples:
|
||||
getListNoProducts:
|
||||
No products / Empty list:
|
||||
summary: No products / Empty list
|
||||
description: No products
|
||||
value:
|
||||
{
|
||||
"Entries": []
|
||||
}
|
||||
List containing one product with many null attributes:
|
||||
summary: List containing one product with many null attributes
|
||||
description: |-
|
||||
Most product attributes are optional on a database level and can thus be null; this example shows that all attributes as defined in the schema are always represented in the response, even if null. \
|
||||
**Empty lists/arrays show up as null, not as "[]"!**
|
||||
value:
|
||||
{
|
||||
"Entries": [
|
||||
{
|
||||
"productId": 99,
|
||||
"productCode": null,
|
||||
"productName": null,
|
||||
"productDescription": null,
|
||||
"productCategory": null,
|
||||
"tokenTypes": null,
|
||||
"sellableTouchPointIds": null,
|
||||
"amountInclTax": null,
|
||||
"imageReference": null,
|
||||
"productPageUrl": null,
|
||||
"_links": {
|
||||
"get_details": {
|
||||
"href": "https://services.acc.api.htm.nl/abt/abtserviceengine/2.0/products/99",
|
||||
"method": "GET"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
List containing one product with 4 currently active SellingPeriods (called by touchpointId 1):
|
||||
summary: List containing one product with 4 currently active SellingPeriods (called by touchpointId 1)
|
||||
description: Only two sellingPeriods for touchpoint 1 and/or 2 (part of same retailer) are returned - the price for touchpointId 1 is returned
|
||||
|
||||
Loading…
Reference in New Issue
Block a user