On Mon, Jan 27, 2014 at 1:34 PM, Andrey Rychkov <[email protected]>
 wrote:

> 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"]}
>



Is there a specific reason you need an array at the top level, instead of
extracting it through the object wrapper? While top level arrays are
standards-compliant JSON, usually people prefer objects at the top level
since they're more extensible in the future.

 If you absolutely need top level arrays from Endpoints, you could always
post-process the response through a servlet filter:
http://docs.oracle.com/javaee/5/api/javax/servlet/Filter.html . I don't
think Endpoints allows for a top level array directly, though.


-----------------
-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 [email protected].
To post to this group, send email to [email protected].
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