Given this hierarchy, the JSON result only returns properties of the base 
class. The base class has the property 'name', the subclass has the additional 
property 'zip' 

What do I need to change? Thanks 

@Override 
public TestResult testSubclass() { 

TestResult testResult = new TestResult(); 

Customer customer = new Customer(); 
customer.setName( "J. Bonham" ); 
customer.setZip( "60011" ); <------------------ does not get included in json 
result 

testResult.setPerson( customer ); 

return( testResult ); 
} 

Result: 

{ 

    • " testResult " : { 
        • " person " : { 
            • " name " : { 
                • " $ " : "J. Bonham" 

} 
} 
} 
} 

Classes: 

@XmlRootElement 
@BadgerFish 
@NoJackson 
public class Person { 

private String name; 

public String getName() { 
return name; 
} 

public void setName(String name) { 
this.name = name; 
} 
} 

@XmlRootElement 
@BadgerFish 
@NoJackson 
public class Customer extends Person { 

private String zip; 

public String getZip() { 
return zip; 
} 

public void setZip(String zip) { 
this.zip = zip; 
} 
} 

@XmlRootElement 
@BadgerFish 
@NoJackson 
public class TestResult { 
private Person person; 

public Person getPerson() { 
return person; 
} 

public void setPerson(Person person) { 
this.person = person; 
} 
} 

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to