Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-56

RepositoryRestHandlerMapping shouldn't register itself with highest precedence

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.0.0 GA
    • Fix Version/s: 1.1.0.M1
    • Component/s: None
    • Labels:
      None

      Description

      RepositoryRestHandlerMapping currently registers itself using Ordered.HIGHEST_PRECEDENCE which makes it impossible for other controllers to blend into the URI space of the exposed resource. E.g. we have Order instances exposed via /orders and a manually implemented controller would like to expose a payment resource for each order by handling /orders/1/payment. Even if the controller registers for this pattern, it does not get selected for request invocations as the RepositoryRestHandlerMapping already answers the lookupHandlerMethod(…) call. This is not consistent to the way mapping resolution works with plain Spring MVC where a more concrete (e.g. a dedicated /orders/

      {id}/payment) trumps a more general mapping (e.g. /{repository}/{id}

      /property).

      In any case, the RepositoryRestHandlerMapping should check whether the third segment of the URI actually really maps to a linkable property or else abstain from handling it.

        Attachments

          Activity

            People

            • Assignee:
              jbrisbin Jon Brisbin
              Reporter:
              olivergierke Oliver Gierke
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: