I get back JSON like the following:
{
Id = a0Ef0000002TPKVEA4;
Name = a0Ef0000002TPKV;
attributes = {
type = "Market__c";
url = "/services/data/v29.0/sobjects/Market__c/a0Ef0000002TPKVEA4";
};
The attributes portion doubles the data size. I've searched the docs but can't find a way to remove it. Here is the code I am using
@HttpGet
global static Aggregate doGet() {
RestRequest req = RestContext.request;
string userid = req.params.get('UserId');
try {
User user = [SELECT FirstName, LastName, Title, Email, Phone, MobilePhone,
Street, City, State, PostalCode, Country, LevelOfCare__c, Username, PERNER__c
FROM User WHERE Id = :userid];
List<Market__c> markets = [SELECT Id, Name FROM Market__c];
return new Aggregate(user, markets);
}
catch (exception e) {
return null;
}
}
global class Aggregate {
public User user {get; set;}
public List<Market__c> markets {get; set;}
public Aggregate(User u, List<Market__c> m) {
user = u;
markets = m;
}
} }