I have a complex class, that have many objects inside, when I do GET, I want to see the full object with all inner objects data, but when I POST, I only want to pass ID's for inner objects.
Example:
class ComplexObject {
private InnerObject1 innerObject1;
private InnerObject2 innerObject2;
//setters and getters
}
when I do GET, I want to retrieve the full JSON, that's the easy part, but when I save the ComplexObject, I want to only pass the id's for the innerObject1 and innerObject2, not the whole object.
How can I achieve that?