Closed exemplari closed 2 years ago
We have to check that in more detail because it's not obvious why this error message is returned
Think we've fixed the problem. Can you please execute
composer req aimeos/ai-client-jsonapi:2021.07.x-dev
and check if it works for you too?
Does not seem fixed. The links for included.$addressItem.links.self is still prefixing with "customer/" and sending patch or delete there is "Not allowed for this resource"
"aimeos/ai-client-jsonapi", "version": "2021.07.x-dev", 0c764ae0f58ad43abdf65c00d0fa4712ead1e704
{
"meta": {
...
},
"links": {
"self": "http://www.mysite.com/jsonapi/customer?include=customer%2Faddress&site=default",
"customer/address": {
"href": "http://www.mysite.com/jsonapi/customer?id=466&related=address&site=default",
"allow": ["GET", "POST"]
},
...
},
"data": {
"id": "466",
"type": "customer",
"links": {
"self": {
"href": "http://www.mysite.com/jsonapi/customer?id=466&site=default",
"allow": ["DELETE", "GET", "PATCH"]
}
},
"attributes": {
...
},
"relationships": {
"customer/address": {
"data": [
{ "id": "3", "type": "customer/address" },
{ "id": "4", "type": "customer/address" }
]
}
}
},
"included": [
{
"id": "3",
"type": "customer/address",
"attributes": {
...
},
"links": {
"self": {
"href": "http://www.mysite.com/jsonapi/customer?id=466&related=customer%2Faddress&relatedid=3&site=default",
"allow": ["DELETE", "GET", "PATCH"]
},
"basket/address": {
"href": "http://www.mysite.com/jsonapi/basket?id=default&related=address&relatedid=payment&site=default",
"allow": ["POST"]
}
}
},
{
"id": "4",
"type": "customer/address",
"attributes": {
...
},
"links": {
"self": {
"href": "http://www.mysite.com/jsonapi/customer?id=466&related=customer%2Faddress&relatedid=4&site=default",
"allow": ["DELETE", "GET", "PATCH"]
},
"basket/address": {
"href": "http://www.mysite.com/jsonapi/basket?id=default&related=address&relatedid=payment&site=default",
"allow": ["POST"]
}
}
}
]
}
Thanks to the hint, it's fixed now for customer address and property entries too: https://github.com/aimeos/ai-client-jsonapi/commit/76815ba5e3626e90da3abbb910b45730246f7004
Adding an "include" to the customer get create bad links to access the sub domains (address).
sample response from the included array
{ "errors": [ { "title": "Not allowed for this resource" } ] }