4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
44 stars 63 forks source link

COAR NotifyService IT failures: NotifyServiceInboundPatternsRemoveOpe… #451

Closed frabacche closed 7 months ago

frabacche commented 7 months ago

Bug issue at DSpace github

All *NotifyServiceInboundPatternsRemoveIT* classes has the supports() method: returning true, the class is used to manage the incoming patch request. This boolean is calculated by matching the path sting to the string /notifyServiceInboundPatterns . This path is used as the initial part of many NotifyServiceInboundPatternOperation classes.

org.dspace.app.rest.repository.patch.operation.ldn.NotifyServiceInboundPatternsRemoveOperation is the backend service to delete all the inboundPatterns of a given notifyServiceEntity. It's supports() method is evaluated as true even if the http patch call had the path /notifyServiceInboundPatterns[1]/constraint - and it is wrong because the correct backend to be triggered should be org.dspace.app.rest.repository.patch.operation.ldn.NotifyServiceInboundPatternConstraintRemoveOperation

That said - the solution is to add the condition && path.endsWith(OPERATION_PATH) to the supports() method return condition on NotifyServiceInboundPatternsRemoveOperation class.