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

Never return NEED-TO-CONFIGURE in REST responses

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: 2.12
    • Fix Version/s: 2.13
    • Complexity:
      Low

      Description

      We should stop returning NEED-TO-CONFIGURE within REST responses. If the base URI (webservices.rest.uriPrefix global property) is not defined, then we should use whatever information we have on hand (from ServletContext, PageContext, and, if necessary, the request itself) to infer the proper base URI (protocol + host + ":port" if not ":80" + base for web app).

      Current behavior

      Assuming demo.openmrs.org does not have a value defined for the webservices.rest.uriPrefix global property.

      curl -u admin:Admin123 http://demo.openmrs.org/openmrs/ws/rest/v1/patient?q=van
      {
        "results": [
          {
            "uuid": "c77c858d-3978-4135-8c4b-d85d34d3e811",
            "display": "10012R - dijk van John",
            "links": [
              {
                "rel": "self",
                "uri": "NEED-TO-CONFIGURE/ws/rest/v1/patient/c77c858d-3978-4135-8c4b-d85d34d3e811"
              }
            ]
          }
        ]
      }
      

      Expected behavior

      Assuming demo.openmrs.org does not have a value defined for the webservices.rest.uriPrefix global property.

      curl -u admin:Admin123 http://demo.openmrs.org/openmrs/ws/rest/v1/patient?q=van
      {
        "results": [
          {
            "uuid": "c77c858d-3978-4135-8c4b-d85d34d3e811",
            "display": "10012R - dijk van John",
            "links": [
              {
                "rel": "self",
                "uri": "http://demo.openmrs.org/openmrs/ws/rest/v1/patient/c77c858d-3978-4135-8c4b-d85d34d3e811"
              }
            ]
          }
        ]
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              raff Rafal Korytkowski
              Reporter:
              burke Burke Mamlin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: