[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wink-user
Subject:    Issue with String JSON representation
From:       Paulo Borges <abudar63 () hotmail ! com>
Date:       2013-08-07 16:30:08
Message-ID: BAY171-W1650FE81AA7B948A60AFE1CB5E0 () phx ! gbl
[Download RAW message or body]

I am using the WINK implementation shipped with WebSphere V8. I have came across an \
issue that I think may be a possible bug. I am also using JSON Jackson that is \
shipped as part of WebSphere runtime for JSON/Object conversions.

When I have the following line in my handler:

return Response.ok(user.getName()).build();

I get the following exception on the client when I try to get the Name value

org.codehaus.jackson.JsonParseException: Unexpected character ('c' (code 99)): ....

Looking at my response I see the name Doe,Jhon there. Note that the name String is \
not quoted and hence the parser fails.

Now if I go and change my server code to 

 return Response.ok("\""+user.getName()+"\"").build();

The response would look as "Doe,John" and hence all works and I get no exception on \
the client side.

When one or more Java objects are returned as part of response in 'ok' method, I see \
all property name and values as quoted and not sure why a single String value is not.

I am not sure whether this is a bug in JSON provider [JSON Jackson shipped in \
WebSphere]  I use on the Server or a bug in WINK. 		 	   		  =


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic