Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-1898

Representation of request-object differs between code and json-representation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Expired
    • Affects Version/s: OpenIDM 3.0.0
    • Fix Version/s: None
    • Component/s: Module - Scripting
    • Labels:
    • Environment:
      openidm-3.0.0 snapshot

      Description

      This is my endpoint:

      for (var value in request){
        result = value;
        logger.info(value + " -> " + request[value]);
        // if (value == "name") doSomething();
      }
      request;
      

      If I perform a get-request, my result is:

      {"fields":[],"resourceName":"user/a","requestType":"READ","resourceNameObject":{"empty":false},"additionalParameters":{}}
      

      However, my log tells me:

      INFO: method -> read
      INFO: fields -> [  ]
      INFO: resourceName -> user/a
      INFO: additionalParameters -> {  }
      

      So, performing REST I get "requestType" and a value of "READ" and no resourceNameObject is present. In Javascript I can't access "requestType", instead I have to check for method. And it is "read" instead of "READ".
      Took me quite some time to spot that issue, since I didn't expect any kind of transformation taking place when returing the object via REST.

        Attachments

          Activity

            People

            • Assignee:
              jake.feasel Jake Feasel
              Reporter:
              patrick.hagen@kit.edu Patrick von der Hagen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: