I’m trying to get PATCHes working against an Omeka-S 2.1.2 installation. I find that a simple curl test appears to be accepted (Omeka returns a 200), but the item is unchanged.
So, my first question: is JSON Patch the right syntax for the patch? If not, what should I use?
Here is a simple test, using curl. I’m able to create items with curl using POST, so I know the basic API framework is working. In this example I’m just trying to update the o:title of an item from “Peter at Fountains Abbey” to “Patched title”. The returned payload shows that it is unchanged.
$ curl -vs -X PATCH -H 'Content-type: application/json' --data-raw \
'[{"op": "replace", "path": "/o:title", "value": "Patched title"}]' \
"https://omeka.mydomain.com/api/items/11?key_identity=xxxxxx&key_credential=yyyyyy" > curltest.txt 2>&1
> PATCH /api/items/11?key_identity=xxxxxx&key_credential=yyyyyy HTTP/1.1
> Host: omeka.mydomain.com
> User-Agent: curl/7.52.1
> Accept: */*
> Content-type: application/json
> Content-Length: 65
>
} [65 bytes data]
* upload completely sent off: 65 out of 65 bytes
{ [5 bytes data]
< HTTP/1.1 200 OK
< Date: Thu, 20 Aug 2020 18:18:50 GMT
< Server: Apache
< Omeka-S-Version: 2.1.2
< Cache-Control: max-age=172800
< Expires: Sat, 22 Aug 2020 18:18:50 GMT
< Vary: User-Agent
< Transfer-Encoding: chunked
< Content-Type: application/json; charset=utf-8
<
{ [5 bytes data]
* Curl_http_done: called premature == 0
* Connection #0 to host omeka.mydomain.com left intact
{"@context":"https:\/\/omeka.mydomain.com\/api-context","@id":"https:\/\/omeka.mydomain.com\/api\/items\/11","@type":"o:Item","o:id":11,"o:is_public":true,"o:owner":{"@id":"https:\/\/omeka.mydomain.com\/api\/users\/1","o:id":1},"o:resource_class":null,"o:resource_template":null,"o:thumbnail":null,"o:title":"Peter at Fountains Abbey","o:created":{"@value":"2020-08-14T21:11:12+00:00","@type":"http:\/\/www.w3.org\/2001\/XMLSchema#dateTime"},"o:modified":{"@value":"2020-08-20T18:18:50+00:00","@type":"http:\/\/www.w3.org\/2001\/XMLSchema#dateTime"},"o:media":[{"@id":"https:\/\/omeka.mydomain.com\/api\/media\/13","o:id":13}],"o:item_set":[],"dcterms:title":[{"type":"literal","property_id":1,"property_label":"Title","is_public":true,"@value":"Peter at Fountains Abbey"}],"dcterms:description":[{"type":"literal","property_id":4,"property_label":"Description","is_public":true,"@value":"A man walks below broken gothic arches"}],"dcterms:type":[{"type":"literal","property_id":8,"property_label":"Type","is_public":true,"@value":"Image"}],"dcterms:creator":[{"type":"literal","property_id":2,"property_label":"Creator","is_public":true,"@value":"Elizabeth Wall"}],"dcterms:identifier":[{"type":"literal","property_id":10,"property_label":"Identifier","is_public":true,"@value":"pfountains3"}],"o-module-mapping:marker":[{"@id":"https:\/\/omeka.mydomain.com\/api\/mapping_markers\/1","o:id":1}]}