Just an update on my end.
Because there is no response, It seems that the replace as shown previously 
is not supported, at this stage.
The way to do the replace currently is to include the op:remove first then 
op:add for each as shown below.
Hope this helps.
FYI:
- The minus on subject to ensure that it is added after the first subject, 
otherwise the order will be in reverse.
- This is tested on version 7 and 8. Both seems have to be done as below.

[
  {
    "op": "remove",
    "path": "/metadata/dc.subject"
  },
  {
    "op": "add",
    "path": "/metadata/dc.subject",
    "value":"test1"
  },
  {
    "op": "add",
    "path": "/metadata/dc.subject/-",
    "value":"test2"
  },
  {
    "op": "add",
    "path": "/metadata/dc.subject/-",
    "value":"test3"
  }
]


Best regards,

Harry Sidhunata
UNSW Sydney Library

On Friday, May 9, 2025 at 9:23:59 PM UTC+10 [email protected] wrote:

> Hi All,
>
> I am current testing the REST API PATCH on /items end point to replace the 
> whole field with new list. I am trying to replace dc:subject with a new 
> list. For example:
>
> The Item has three dc:subject: keyword1, keyword2 keyword3.
> Using the json below to replace the whole dc:subject.
> The result show only the first value has been added dc:subject: test1 
> [
>   {
>     "op": "replace",
>     "path": "/metadata/dc.subject",
>     "value":[
>         {"value" : "test1"},
>         {"value" : "test2"},
>         {"value" : "test3"}
>     ]    
>   }
> ]
> Can we replace the whole field? What is the issue on the json above?
>
> I have tried to test with full properties (language,authority,place), and 
> still show the same behavior.
>
>
> Best regards,
>
> Harry
>
>
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/dspace-tech/069ec9c2-ceda-4bb6-ad04-086fc6d7713en%40googlegroups.com.

Reply via email to