Description
Currently AnyService (and its derivative, providing REST services for users, groups and any objects) defines the update method as follows:
@POST
@Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
Response update(@NotNull MOD anyMod);
where MOD extends AnyMod.
The idea is to move to a definition like as follows:
@PATCH
@Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
Response update(@NotNull P anyPatch);
e.g. to more REST-compliant patch-based update.
This has the additional benefit of simplifying the interaction with clients (JavaScript, in particular) not based on syncope-client Java library.
It could also be useful to add a second update method as follows:
@PUT
@Path("{key}")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
Response update(@NotNull TO anyTO);
where TO extends AnyTO.
This latter would allow to build simpler create / update interactions for clients based on syncope-client Java library.