Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-45197

Accept JSON objects in Invoker for method arguments

    Details

      Description

      In JSONWS it is possible to create objects for non-trivial arguments and set inner fields via request parameters. However, using this in Invoker is not natural - the object has to be 'flatten' and user can not send JSON object instead.

      Here is the example when passing ServiceContext (although here you dont have to create SC instance, it will be already automatically created by portal:

      {
        "/mbmessage/add-message": {
          "something": "…",
          "+serviceContext": "com.liferay.portal.service.ServiceContext",
          "serviceContext.companyId": 12345,
          "serviceContext.scopeGroupId": 23456,
          "serviceContext.addGuestPermissions": true,
          "serviceContext.addGroupPermissions": true
        }
      }
      

      and we want:

      {
        "/mbmessage/add-message": {
          "something": "…",
          "serviceContext": {
            "companyId": 12345,
            "scopeGroupId": 23456,
            "addGuestPermissions": true,
            "addGroupPermissions": true
          }
        }
      }
      

      In general, we might follow this pattern:

      {
        "/mbmessage/add-message": {
          "propertyName:<optional-class-name>": {
            "innerField": "value"
          }
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              albert.lee Albert Lee
              Reporter:
              igor.spasic Igor Spasic (Inactive)
              Recent user:
              Kiyoshi Lee
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M1
                  7.0.0 M7