shopware 6 admin api 補丁 - 為什么會失敗?我收到錯誤"Only single write operations are supported"
以下是rule-condition資料庫中物體的 api,我將其更新為Id. 對于相同的 apiget method正在作業!
url: api/規則條件/dbb0d904c7c14860a9a94cf26b94eca6
method: 修補
json 正文
[
{
"op": "replace",
"path": "/data/attributes/value/email",
"value": "[email protected]"
}
]
回復:
{ "errors": [ { "code": "0", "status": "400", "title": "Bad Request", "detail": "只支持單寫操作。請發送物體一個一個或使用 /sync api 端點。", .......
我也嘗試將 json body 更改為以下
{
"data": {
"attributes": {
"value": {
"email": "[email protected]"
}
}
} }
仍然沒有更新。有人可以檢查并讓我知道我錯過了什么嗎?
我遵循的檔案: https ://shopware.stoplight.io/docs/admin-api/ZG9jOjEyMzA4NTQ5-writing-entities
這個網站有所有的api和示例方法。https://swagger.docs.fos.gg/,
rule-condition物體也可以在那里找到。
順便說一句:我使用郵遞員來測驗 api
uj5u.com熱心網友回復:
您在請求正文中傳遞了一組物件,建議您要更新多條記錄,但端點僅支持更新一條記錄。在您的情況下,正確的有效負載應如下所示:
{
"value": {
"operator": "=",
"email": "[email protected]"
}
}
請注意,這value是一個 json 欄位,不僅包含單個值。屬性的確切內容和名稱value取決于使用的條件型別,通常還包括條件中使用的運算子。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/531292.html
