[
https://issues.apache.org/jira/browse/OFBIZ-12621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17542436#comment-17542436
]
ASF subversion and git services commented on OFBIZ-12621:
---------------------------------------------------------
Commit 2cf8d185f01b87a75e5f74161ca0db6b5767f516 in ofbiz-framework's branch
refs/heads/release22.01 from Jacques Le Roux
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=2cf8d185f0 ]
Improved: Json response failed when element not serializable (OFBIZ-12621)
No functional changes, just removing a compilation warning
While compiling with Java 11 I got this message:
> Task :compileJava
UtilHttp.java:502: warning: [unchecked] unchecked call to
<R>map(Function<? super T,? extends R>) as a member of the raw type Stream
[...]
This fixes it with the help of Eclipse
> 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
> Fix For: 22.01.01
>
> 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)