You are right!

I rewrote the code

public String[] test()
{
return new String[] {"a", "b", "c"};
}

but the endpoint still returns the object

{
  "items": [
    "a",
    "b",
    "c"
  ]
}

I get this result in Google APIs Explorer.

On Saturday, January 25, 2014 7:50:03 AM UTC+4, Vinny P wrote:
>
> On Fri, Jan 17, 2014 at 9:23 AM, Andrey Rychkov 
> <whole...@gmail.com<javascript:>
> > wrote:
>
>> Why does my code return an object?
>>
>> public List<String> test()
>> {  return Arrays.asList("one, "two", "three"); }
>>
>> {  "items": [   "One",   "Two",   "Three"  ] }
>>
>> I expect to receive the array ["one", "two", "three"]. 
>> Is it possible?
>>
>  
>
>
> Arrays.asList returns an object implementing the interface List<T>, so 
> what you're seeing is the correct behavior.
>
> Are you receiving this object text in the endpoint client, or somewhere 
> within the server code?
>  
>  
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
> App Engine Code Samples: http://www.learntogoogleit.com
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to