Uploaded image for project: 'Clerezza (Retired)'
  1. Clerezza (Retired)
  2. CLEREZZA-570

triaxrs/RootResourceExecutorImpl could (should) do better pattern matching on methods

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • None
    • None
    • None

    Description

      I am developing a class for a resource that could take or not take certain parameters.

      @GET def infoPage() : Response =

      { .. }

      @GET def authenticate(@QueryParam("authreqissuer") relyingPartySrvc: URL ): Response =

      { ... }
      @GET def authenticate(@QueryParam("authreqissuer") relyingPartySrvc: URL , @QueryParam("pause") pause: Boolean): Response = { ... }

      So I assumed naively - but that may say something about general newbie expectations - that the methods that would match most parameters would be selected.

      It turns out that it is the first method that is called in RootResourceExecutorImpl

      final MethodAndConsumedAndProducibleTypes firstAcceptable = acceptableMethods.first();

      This leads to inconsistent and random behavior, as different functions are called for different request of the same URI request.
      So a GET request on https://localhost:8443/srvc/webidp can call all of the above functions. It then furthermore throws exceptions when it does not have the data for a method.

      As I saw these errors thrown I refactored my code a few times, and finally discovered this was a problem in the triaxrs code.

      One could make a list of (attribute annotation pairs) and find out which methods had the most of the attribtes available in the URI.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bblfish Henry Story
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment