Problem/Motivation
Create a commerce_wishlist entity through json api without setting the wishlist_items like we can in the web UI.
Steps to reproduce
POST: /jsonapi/commerce_wishlist/default
{
"data": {
"type": "commerce_wishlist--default",
"attributes": {
"name": "My custom title"
}
}
}
ERROR:
"errors": [
{
"title": "Unprocessable Entity",
"status": "422",
"detail": "wishlist_items: This value should not be null.",
"source": {
"pointer": "/data/attributes/wishlist_items"
}
}
],
Proposed resolution
Allow to creating the empty wishlist like in:
$wishlist_provider->createWishlist('playlist', $this->currentUser);
Comments
Comment #2
introfini commentedAs discussed on Slack with Matt:
Here is the patch that removes the required flag...
Comment #4
jsacksick commented