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

Preserve @JSON annotation information when converting objects to map in JSONWS Invoker

    Details

      Description

      JSON Invoker may 'expand' the returned object by adding properties to it. What happens in the background is that in this case the object is converted to a map, and then the map is expanded. This process follows the @JSON annotation, but, we are losing this information once when object is returned as a map. This information is needed when the final result object is returned and then serialized.

      Example:

      {'$foo = /service/method': {
      	arg1: 10178
      }
      

      Lets say that this service method returns object Foo, that has some @JSON hints how to serialize it. This call would return correctly serialized object. But, if we want to add a property:

      {'$foo = /service/method': {
      	arg1: 10178,
      	$newproperty = /service2/method2 {...}
      }
      

      Now the returned object will contain a new property. Under the hood, the object has been converted to a map. Unfortunately, @JSON information have been lost, and some other properites of base class may be missing or appearing.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.saechang Michael Saechang
                Reporter:
                igor.spasic Igor Spasic (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 years, 23 weeks ago

                  Packages

                  Version Package
                  6.2.0 CE M5