You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Mike Roberts (JIRA)" <ji...@apache.org> on 2018/09/10 11:31:00 UTC

[jira] [Comment Edited] (OLINGO-1276) Client incorrectly parses stream with left brace in JSON string

    [ https://issues.apache.org/jira/browse/OLINGO-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16609037#comment-16609037 ] 

Mike Roberts edited comment on OLINGO-1276 at 9/10/18 11:30 AM:
----------------------------------------------------------------

I have encountered a very similar issue but with a JSON string containing a right brace '}' character. For example in this response ...

{"@odata.context":"$metadata#Cubes(Name)","value":[\\{"@odata.etag":"W/\"c24af675e00a3f95ef63f223fb9c2cc8d6455459\"","Name":"}Capabilities"}]}

This is when using the IBM Cognos TM1 REST API - all control object names start with '}'.

The ClientEntitySetIterator method logs an error but the iterator ends normally i.e. hasNext() returns false. Not sure if the proposed fix covers this case as well.


was (Author: mikerobe):
I have encountered a very similar issue but with a JSON string containing a right brace '}' character. For example in this response ...

{"@odata.context":"$metadata#Cubes(Name)","value":[\{"@odata.etag":"W/\"c24af675e00a3f95ef63f223fb9c2cc8d6455459\"","Name":"}Capabilities"}]}

This is when using the IBM Cognos TM1 REST API - all control object names start with '}'.

The ClientEntitySetIterator method logs an error but the iterator ends normally i.e. hasNext() returns false. Not sure if the proposed fix covers this case as well.

> Client incorrectly parses stream with left brace in JSON string
> ---------------------------------------------------------------
>
>                 Key: OLINGO-1276
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1276
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-client
>    Affects Versions: (Java) V4 4.4.0
>            Reporter: Kristof Lievens
>            Priority: Blocker
>             Fix For: (Java) V4 4.5.0
>
>         Attachments: 0001-fixes-issue-when-JSON-stream-contains-a-left-brace-i.patch
>
>
> When a JSON string contains a '{' character, the response stream is incorrectly parsed into OData entities by the org.apache.olingo.client.api.domain.ClientEntitySetIterator class.
> Please check the patch file in attachment with a fix for the issue.
> This bug has already been reported in February 2015, see [https://github.com/apache/olingo-odata4/pull/4.] I didn't notice the fix linked to this Github issue before I started coding my own fix, but it looks pretty similar.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)