Currently we have some endpoints which are essentialy a PATCH but the request is to not leverage on JSONPatch o JSONMergePatch objects because endpoints must have specific DTOs as body.
My idea is to have the same @PATCH endpoint consumes different types:
@Path("path/to/resource")
@PATCH
@Consumes(???)
void modificationOne(DTO#1 modifications) {
}
@Path("path/to/resource")
@PATCH
@Consumes(???)
void modificationTwo(DTO#2 modifications) {
}
I'm struggle about @Consumes() media type:
application/vnd.patch.modificationOne+json,application/vnd.patch.modificationTwo+jsonapplication/json-patch+json; type=DTO#1,application/json-patch+json; type=DTO#2
Anyone with some advices for a better and/or more pratical solution?