Uploaded image for project: 'Syncope'
  1. Syncope
  2. SYNCOPE-694

PATCH and PUT update for users, groups and any objects

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-M1
    • Component/s: None
    • Labels:

      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.

        Attachments

          Activity

            People

            • Assignee:
              ilgrosso Francesco Chicchiriccò
              Reporter:
              ilgrosso Francesco Chicchiriccò
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: