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

Error When Posting Relationship With Full Representation of a RelationshipType

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • 2.29.0
    • None
    • None

    Description

      When posting the relationship as the one below.

      {
          "personA": "UUID of first person",
          "relationshipType": {
               "uuid": "8d91a01c-c2cc-11de-8d13-0010c6dffd0f",
              "display": "Sibling/Sibling",
              "description": "Relationship between brother/sister, brother/brother, and sister/sister",
              "aIsToB": "Sibling",
              "bIsToA": "Sibling",
              "displayAIsToB": "Sibling",
              "displayBIsToA": "Sibling",
              "retired": false,
              "links": [
                  {
                      "rel": "self",
                      "uri": "http://192.168.1.20/openmrs/ws/rest/v1/relationshiptype/8d91a01c-c2cc-11de-8d13-0010c6dffd0f"
                  },
                  {
                      "rel": "full",
                      "uri": "http://192.168.1.20/openmrs/ws/rest/v1/relationshiptype/8d91a01c-c2cc-11de-8d13-0010c6dffd0f?v=full"
                  }
              ],
              "resourceVersion": "1.8"
          },
          "personB": "UUID of the second person"
      }
      

      The module responds with the following error.

      org.openmrs.module.webservices.rest.web.response.ConversionException: relationshipType on class org.openmrs.Relationshiporg.openmrs.module.webservices.rest.web.response.ConversionException: relationshipType on class org.openmrs.Relationship
       at org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setProperty(BaseDelegatingResource.java:805) at org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setConvertedProperties(BaseDelegatingResource.java:672) at org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.convert(DelegatingCrudResource.java:107) at org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.create(DelegatingCrudResource.java:76) at org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9.RelationshipResource1_9Test.createShouldIgnoreRelationshipSpecificDisplayPropertiesWhenCreating(RelationshipResource1_9Test.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)Caused by: org.openmrs.module.webservices.rest.web.response.ConversionException: displayAIsToB on class org.openmrs.RelationshipType at org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setProperty(BaseDelegatingResource.java:805) at org.openmrs.module.webservices.rest.web.ConversionUtil.convertMap(ConversionUtil.java:323) at org.openmrs.module.webservices.rest.web.ConversionUtil.convert(ConversionUtil.java:273) at org.openmrs.module.webservices.rest.web.ConversionUtil.convert(ConversionUtil.java:155) at org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setProperty(BaseDelegatingResource.java:800) ... 39 moreCaused by: java.lang.NullPointerException at org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setProperty(BaseDelegatingResource.java:797) ... 43 more

      Gliffy Diagrams

        Attachments

          Activity

            People

              willa Willa Mhawila
              willa Willa Mhawila
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: