Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-12621

Json response failed when element not serializable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 22.01.01, Upcoming Branch
    • 22.01.01
    • framework/webapp

    Description

      When you forward a request-map on json response after a service call like this :

       

           <request-map uri="updateMyEntity">
              <security https="true" auth="true"/>
              <event type="service" invoke="serviceWithUnserializableElement"/>
              <response name="success" type="request" value="json"/>
              <response name="error" type="request" value="json"/>
          </request-map>
      

      The request json works fine if the serviceWithUnserializableElement have an element unserializable on out put at the first level

           <service name="serviceWithUnserializableElement"...>
              <attribute name="outputStream" type="java.io.OutputStream" mode="OUT"/>
          </service>
      

      If the definition is like this 

           <service name="serviceWithUnserializableElement"...>
              <attribute name="outputStreamMap" type="Map" mode="OUT"/>
          </service>

      The json failed to generate if the outputStream is a map en

      try here :

      CommonEvents.jsonResponseFromRequestAttributes:
      
                  JSON json = JSON.from(attrMap);
                  writeJSONtoResponse(json, request, response);
      

      Despite the function UtilHttp.getJSONAttributeMap that safe only the first map level and don't work in deep.

       

       

      Attachments

        1. OFBIZ-12621.patch
          3 kB
          Nicolas Malin

        Activity

          People

            nmalin Nicolas Malin
            nmalin Nicolas Malin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: