I've a Java POJO which looks like this:

class User {
  public String name;
  public String location;
  public String userType;

  public User(...) {
    ...
  }

  public String getName() {
    return name;
  }

  ...
}

With CloudEndpoints, if all 3 instance variable are initialised (with 
values), the serialised jSON would look like this: {"name":"john doe", 
"location":"Frankfurt", "userType": "admin"}


However, if one or more of those instance variables does not hold any 
value, then EndPoint simply ignores those values. For example, if location 
isn't defined, but name and userType is, then the output would be {"name":"john 
doe", "userType": "admin"}


How can I force EndPoint to return null values too?

I've already tried to use @JsonInclude(JsonInclude.Include.ALWAYS) on the 
POJO class, but it doesn't work. Any tips?


Question is also posted on 
SO: https://stackoverflow.com/questions/45361815/how-to-return-null-entities

-- 
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 https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/c622443a-652e-4155-904a-c316111d4e1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to