[ 
https://issues.apache.org/jira/browse/OFBIZ-12621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Malin updated OFBIZ-12621:
----------------------------------
    Attachment: OFBIZ-12621.patch

> Json response failed when element not serializable
> --------------------------------------------------
>
>                 Key: OFBIZ-12621
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12621
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework/webapp
>    Affects Versions: 22.01.01, Upcoming Branch
>            Reporter: Nicolas Malin
>            Assignee: Nicolas Malin
>            Priority: Major
>              Labels: json, webapp
>         Attachments: OFBIZ-12621.patch
>
>
> When you forward a request-map on json response after a service call like 
> this :
>  
> {code:java}
>      <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>
> {code}
> The request json works fine if the serviceWithUnserializableElement have an 
> element unserializable on out put at the first level
> {code:java}
>      <service name="serviceWithUnserializableElement"...>
>         <attribute name="outputStream" type="java.io.OutputStream" 
> mode="OUT"/>
>     </service>
> {code}
> If the definition is like this 
> {code:java}
>      <service name="serviceWithUnserializableElement"...>
>         <attribute name="outputStreamMap" type="Map" mode="OUT"/>
>     </service>{code}
> The json failed to generate if the outputStream is a map en
> try here :
> {code:java}
> CommonEvents.jsonResponseFromRequestAttributes:
>             JSON json = JSON.from(attrMap);
>             writeJSONtoResponse(json, request, response);
> {code}
> Despite the function UtilHttp.getJSONAttributeMap that safe only the first 
> map level and don't work in deep.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to