Shaun
Shaun

Reputation: 1601

Why don't Google Cloud Endpoints Support Simple Object Return Types?

Most of my methods return Strings, Integers, Booleans, etc and I bet that holds for 99% of developers, sure we sometimes return complex objects, arrays, etc. but most of the time something much simpler will do.

Why would Cloud Endpoints not support this? Thanks!

Upvotes: 3

Views: 1019

Answers (2)

loosebazooka
loosebazooka

Reputation: 2433

So there are workarounds for returning "simple object types", in java you could return a StringResponse which would look something like this:

class StringResponse {
  String value;
  setter, getter... etc
}

Upvotes: 5

SnakeDoc
SnakeDoc

Reputation: 14421

Because they are communicating with various programming languages that may or may not support the same data types. This is why most web API's will use something like XML or JSON as the data response type since it's standardized and parsable from any language.

Upvotes: 1

Related Questions