Uploaded image for project: 'Webservices REST Module'
  1. Webservices REST Module
  2. RESTWS-421

Remove all usages of "findMethod" in resources (so that all properties are available in custom representations)

    XMLWordPrintable

Details

    • Story
    • Status: Closed
    • TBD
    • Resolution: Fixed
    • None
    • 2.13
    • None
    • Undetermined

    Description

      If a property on a REST resources is defined like

      description.addProperty("auditInfo", findMethod("getAuditInfo"));
      

      then it is not possible to get that property when you request a custom representation of the resource, e.g. ?v=custom:(uuid,auditInfo)

      Acceptance Criteria

      1. The "findMethod" method should have no usages in the webservices.rest module
      2. You should be able to request any resource with ?v=custom:(uuid,auditInfo)

      Dev Notes

      This is an inherent problem in the framework, since those properties are defined individually for each representation (full, default, etc) in the getRepresentationDescription method, but aren't exposed elsewhere.

      However there's an easy fix: any method that used to be found using "findMethod" in the representation description can just have a @PropertyGetter("propertyName") annotation put on it. See how this was done for the "display" property here: https://github.com/openmrs/openmrs-module-webservices.rest/commit/49ddecc90312e3861255f24ebad606bed9fb3615

      We will need to leave the "findMethod" method around in case other modules use this.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                lluismf Lluis Martinez
                mogoodrich Mark Goodrich
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: