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

Going to catalog API using JSON causes stack overflow due to subtypes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.7
    • Labels:
      None
    • Complexity:
      Low

      Description

      We set up the demo webserver, and connected REST web services 1.10 module.

      I connected to the catalog API suggested in the docs using Content-type: application/json (I used the Postman chrome extension), using URL
      http://

      {server}

      :8080/openmrs/ws/rest/v1/catalog

      It returned a 500 (Internal error). The output looked ok to start with, then at the end of the reply it had:

      {"description":"Delete this object from the database","name":"DELETE http://104.155.15.141:8080/openmrs/ws/rest/v1/order/

      {uuid}?purge"},{"description":"Retire/Void this object","name":"DELETE http://104.155.15.141:8080/openmrs/ws/rest/v1/order/{uuid}

      ?!purge"}],"resourceName":"v1/order","subResourceName":null,"superResource":null,"url":"http://104.155.15.141:8080/openmrs/ws/rest/v1/order","subResources":[{"operations":[],"resourceName"{"error":{"message":"Infinite recursion (StackOverflowError) (through reference chain: org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]>org.openmrs.module.webservices.docs.ResourceDoc[\"subResources\"]>java.util.ArrayList[0]>org.openmrs.module.webservices.docs.ResourceDoc[\"superResource\"]->org.openmrs.mod ...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darius Darius Jazayeri
              Reporter:
              nfortescue Nick Fortescue
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: